Skip to content

Commit

Permalink
Add action to update release draft version level
Browse files Browse the repository at this point in the history
  • Loading branch information
zhx828 committed Jun 6, 2022
1 parent 35a9e9e commit c16b64f
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/after-master-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: After master commit

on:
push:
branches:
- master

jobs:
check-version-level-and-update:
if: github.repository == 'oncokb/oncokb-annotator'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: 'Update Version Level'
run: |
git pull
VERSION_LEVEL=$(cat .version-level | tr "[:upper:]" "[:lower:]")
RELEASE_DRAFTER_MINOR='NEXT_MINOR_VERSION'
RELEASE_DRAFTER_PATCH='NEXT_PATCH_VERSION'
if [[ $VERSION_LEVEL == 'minor' ]]; then
sed -i "s/$RELEASE_DRAFTER_PATCH/$RELEASE_DRAFTER_MINOR/gi" .github/release-drafter.yml
fi
if [[ $VERSION_LEVEL == 'patch' ]]; then
sed -i "s/$RELEASE_DRAFTER_MINOR/$RELEASE_DRAFTER_PATCH/gi" .github/release-drafter.yml
fi
CHANGED=$(git diff --name-only HEAD --)
if [ -n "$CHANGED" ]
then
git config user.name oncokb-bot
git config user.email dev.oncokb@gmail.com
git add .
git commit -m "Update action files to align the version level to $VERSION_LEVEL"
git push
fi
1 change: 1 addition & 0 deletions .version-level
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
minor

0 comments on commit c16b64f

Please sign in to comment.