From febc195624ec9e70face00b5ec882ce6ebf2584f Mon Sep 17 00:00:00 2001 From: Autumn Date: Tue, 25 Jun 2024 14:04:11 -0700 Subject: [PATCH] ci: get all history for a change log generator --- .github/workflows/build.yml | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0c0d202..c18fc62 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 @@ -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: