Automatic Version Bump #5
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Automatically bump version | |
on: | |
workflow_dispatch: | |
pull_request: | |
concurrency: | |
group: "bump" | |
cancel-in-progress: true | |
permissions: | |
contents: write | |
jobs: | |
bump-version: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Bump version | |
run: | | |
git config --global user.name "Github Action Automation" | |
git config --global user.email "nsg@users.noreply.github.com" | |
OLD_VERSION=$(cat VERSION) | |
make version-update | |
NEW_VERSION=$(cat VERSION) | |
BRANCH_NAME="bump-$NEW_VERSION" | |
if git ls-remote --exit-code "$REMOTE_URL" "refs/heads/$BRANCH_NAME" >/dev/null 2>&1; then | |
echo "Branch $BRANCH_NAME already exists." | |
exit 0 | |
fi | |
if [ "$OLD_VERSION" != "$NEW_VERSION" ]; then | |
git checkout -b $BRANCH_NAME | |
git add . | |
git commit -m "Bump version to $NEW_VERSION" | |
git push -u origin $BRANCH_NAME | |
fi | |
# - name: Create pull request | |
# run: > | |
# gh pr create -B master -H test123 --title 'TEST: V1.71' --body 'Created by Github action' | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |