Skip to content

Commit 7c97831

Browse files
committed
Amend latest commit instead of creating a new one
The version's patch number equals the commit count. Creating a new commit changes that count, causing invoke setver to find another version bump on the next CD run — an infinite loop. Amending the triggering commit keeps the count unchanged, so the subsequent CD run finds no version change and stops. Force push is needed because the amended SHA differs from origin, but is safe here since allow_force_pushes is enabled and TEAM4-0 has the ruleset admin bypass.
1 parent a437b6d commit 7c97831

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

.github/workflows/cd_release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ env:
1414
jobs:
1515
update_version:
1616
name: Update the version
17-
if: github.repository_owner == 'EMMC-ASBL' && !startsWith(github.event.head_commit.message, '[bot]')
17+
if: github.repository_owner == 'EMMC-ASBL'
1818
runs-on: ubuntu-latest
1919
outputs:
2020
continue_workflow: ${{ steps.update_version_step.outputs.continue_workflow }}
@@ -71,11 +71,11 @@ jobs:
7171
if: steps.update_version_step.outputs.continue_workflow == 'true'
7272
run: |
7373
git add app/__init__.py CHANGELOG.md
74-
git commit -m "[bot] Update version and CHANGELOG"
74+
git commit --amend --no-edit
7575
7676
- name: Update '${{ env.DEFAULT_REPO_BRANCH }}'
7777
if: steps.update_version_step.outputs.continue_workflow == 'true'
78-
run: git push origin ${{ env.DEFAULT_REPO_BRANCH }}
78+
run: git push --force origin ${{ env.DEFAULT_REPO_BRANCH }}
7979

8080
publish_container_image:
8181
name: Publish Container image on GH Packages

0 commit comments

Comments
 (0)