Skip to content

Commit 8ac7150

Browse files
heitorlessarubenfonseca
authored andcommitted
fix(ci): gracefully and successful exit changelog upon no changes
1 parent cddd6e5 commit 8ac7150

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/workflows/reusable_publish_changelog.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,15 @@ jobs:
2626
git config user.name "Release bot"
2727
git config user.email "aws-devax-open-source@amazon.com"
2828
git config pull.rebase true
29-
git config remote.origin.url >&- || git remote add origin https://github.com/$origin # Git Detached mode (release notes) doesn't have origin
30-
git pull origin $BRANCH
29+
git config remote.origin.url >&- || git remote add origin https://github.com/"${origin}" # Git Detached mode (release notes) doesn't have origin
30+
git pull origin "${BRANCH}"
3131
- name: "Generate latest changelog"
3232
run: make changelog
3333
- name: Update Changelog in trunk
3434
run: |
35+
HAS_CHANGE=$(git status --porcelain)
36+
test -z "${HAS_CHANGE}" && echo "Nothing to update" && exit 0
3537
git add CHANGELOG.md
3638
git commit -m "update changelog with latest changes"
37-
git pull origin $BRANCH # prevents concurrent branch update failing push
38-
git push origin HEAD:refs/heads/$BRANCH
39+
git pull origin "${BRANCH}" # prevents concurrent branch update failing push
40+
git push origin HEAD:refs/heads/"${BRANCH}"

0 commit comments

Comments
 (0)