Skip to content

Commit

Permalink
Merge pull request #6993 from cPu1/fix-merge-release-workflow
Browse files Browse the repository at this point in the history
Fix merge release workflow when there is nothing to merge
  • Loading branch information
cPu1 authored Aug 22, 2023
2 parents 4fa8da6 + 9a06690 commit 63214ae
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/release-merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,22 @@ jobs:
with:
token: "${{ secrets.GITHUB_TOKEN }}"
- name: Merge release branch into ${{env.DEFAULT_BRANCH}}
id: merge-changes
run: |
git checkout $DEFAULT_BRANCH
git checkout -b merge-${{ github.sha }}
git merge --no-commit --no-ff ${{ github.ref }}
if [ "$(git merge --no-commit --no-ff ${{ github.ref }})" = "Already up to date." ]; then
exit 0;
fi
git checkout ORIG_HEAD -- $VERSION_FILE
git add $VERSION_FILE
EDITOR=true git merge --continue
! git diff --exit-code $DEFAULT_BRANCH...HEAD || exit 1
git push --set-upstream origin HEAD
echo "changes=true" >> $GITHUB_OUTPUT
- uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 #v6.4.1
name: Open PR to ${{env.DEFAULT_BRANCH}}
if: steps.merge-changes.outputs.changes == 'true'
with:
github-token: ${{ secrets.EKSCTLBOT_TOKEN }}
script: |
Expand Down

0 comments on commit 63214ae

Please sign in to comment.