Skip to content

Commit

Permalink
fetch before check
Browse files Browse the repository at this point in the history
  • Loading branch information
goastler committed Oct 16, 2024
1 parent 8e10c1e commit 019d654
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/bump_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,16 @@ jobs:
git config user.name "prosoponator[bot]"
git config user.email "[email protected]"
# checkout the src branch
git fetch --all
git checkout ${{ github.event.inputs.src }}
# check the source branch (e.g. staging) is up-to-date with the dest branch (e.g. main)
if [ "$(git rev-list --count origin/${{ github.event.inputs.src }}..origin/${{ github.event.inputs.dest }})" -ne "0" ]; then
echo "Source branch ${{ github.event.inputs.src }} is not up-to-date with destination branch ${{ github.event.inputs.dest }}. PR destination branch into the source branch and try again."
exit 1
fi
# checkout the src branch
git fetch --all
git checkout ${{ github.event.inputs.src }}
git pull
INTERIM="${{ github.event.inputs.interim}}"
# set the interim branch name to release/<version_number> if not provided
INTERIM="${INTERIM:-release/${{ github.event.inputs.version }}}"
Expand Down

0 comments on commit 019d654

Please sign in to comment.