Skip to content

Commit

Permalink
feature: add unreleased to changelog if necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
0xWOF committed Jun 27, 2024
1 parent d520564 commit b741dcd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/gitflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ env.SOURCE_BRANCH }}
token: ${{ env.TOKEN }}

- name: Checkout commit
Expand All @@ -203,6 +204,14 @@ jobs:
run: |
cat ${{ env.CHANGELOG }} \
| grep '^${{ env.VERSION_HEADER }}Unreleased$' \
|| ( \
echo "$(echo '${{ env.VERSION_HEADER }}Unreleased\n' | cat - ${{ env.CHANGELOG }})" > ${{ env.CHANGELOG }}; \
git config user.name github-actions; \
git config user.email [email protected]; \
git add ${{ env.CHANGELOG }}; \
git commit -m "document: add Unreleased to ${{ env.CHANGELOG }}"; \
git push; \
) \
|| (echo 'failure=changelog-not-contains-unreleased' >> $GITHUB_OUTPUT; exit 1)
git diff --name-only ${{ env.DESTINATION_COMMIT }} \
| grep --perl-regexp 'changelog\.md' \
Expand Down

0 comments on commit b741dcd

Please sign in to comment.