Skip to content

Commit

Permalink
ci: get all history for a change log generator
Browse files Browse the repository at this point in the history
  • Loading branch information
autumnjolitz committed Jun 25, 2024
1 parent 2ce45fd commit febc195
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ jobs:
steps:
-
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Set up Python 3.11
uses: actions/setup-python@v4
Expand All @@ -84,22 +86,32 @@ jobs:
invoke setup --devel --no-project
-
name: Update changelog
name: Warn changelog out of sync
if: ${{ github.ref_type != 'tag' }}
run: |
invoke update-changes
if ! git diff-index --quiet HEAD --
then
git config user.name "$(git log -n 1 --pretty=format:%an)"
git config user.email "$(git log -n 1 --pretty=format:%ae)"
git add CHANGES.rst
git commit -m "docs: update CHANGES.rst"
invoke update-changes
git add CHANGES.rst
git commit --amend
git push
exit 253
echo '::warn file=CHANGES.rst,line=1,title=CHANGES.rst out of sync!::Expected invoke update-changes to have zero changes, got instead $(git diff CHANGES.rst).
If you make a tag from this, it *will* error out.'
fi
-
name: Assert changelog in sync
if: ${{ github.ref_type == 'tag' }}
run: |
invoke update-changes
if ! git diff-index --quiet HEAD --
then
echo '::error file=CHANGES.rst,line=1,title=CHANGES.rst out of sync!::Update the changelog.
Suggest you fix that and delete the tag.'
exit 254
fi
-

test_matrix:
needs: [verify_style, verify_types, update-changelog]
strategy:
Expand Down

0 comments on commit febc195

Please sign in to comment.