Skip to content

Commit

Permalink
Merge pull request #141 from dj-wasabi/add-action
Browse files Browse the repository at this point in the history
Added GH Action to automatically update CHANGELOG.md
  • Loading branch information
dj-wasabi authored Jan 6, 2021
2 parents 4d57c29 + e2001ee commit 84d31bd
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# This will execute some scripts on main branch.

name: MasterRun

on:
push:
branches:
- master
- main

workflow_dispatch:

jobs:
runme:
runs-on: ubuntu-latest

steps:
- name: Checkout dj-wasabi-release repo
uses: actions/checkout@v2
with:
repository: dj-wasabi/dj-wasabi-release
path: dj-wasabi-release

- name: Checkout current repo
uses: actions/checkout@v2
with:
path: main

- name: Commit Changelog file
run: |
# We are cloned in the 'main' directory and the dj-wasabi-release
# repository is the 'dj-wasabi-release' next to 'main'
cd main
# Generate CHANGELOG.md file
../dj-wasabi-release/release.sh -d
# Let commit the changes if there are any? (Well there should be!)
if [[ $(git status | grep -c 'CHANGELOG.md' || true) -gt 0 ]]
then echo "Committing file"
git config --global user.name 'Werner Dijkerman [GH bot]'
git config --global user.email 'github@dj-wasabi.nl'
git add CHANGELOG.md
git commit -m "Updated CHANGELOG.md on \"$(date "+%Y-%m-%d %H:%M:%S")\"" CHANGELOG.md
git push
fi
env:
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 84d31bd

Please sign in to comment.