Skip to content

Commit 49e9484

Browse files
CasperWATEAM4-0
authored andcommitted
Amend latest commit instead of creating a new one for version bump (#723)
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. Uses --amend -C HEAD to preserve the original commit author (bot becomes committer only) and --force-with-lease to prevent overwriting any concurrent push that landed since checkout.
1 parent dfc6636 commit 49e9484

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

.github/workflows/cd_release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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 -C HEAD
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-with-lease origin ${{ env.DEFAULT_REPO_BRANCH }}
7979

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

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
**Merged pull requests:**
88

9+
- Amend latest commit instead of creating a new one for version bump [\#723](https://github.com/EMMC-ASBL/oteapi-services/pull/723) ([CasperWA](https://github.com/CasperWA))
910
- Replace push-protected with direct push via TEAM4-0 bypass [\#721](https://github.com/EMMC-ASBL/oteapi-services/pull/721) ([CasperWA](https://github.com/CasperWA))
1011
- Remove \[skip ci\] from bot commit message in CD release [\#720](https://github.com/EMMC-ASBL/oteapi-services/pull/720) ([CasperWA](https://github.com/CasperWA))
1112
- \[pre-commit.ci\] pre-commit autoupdate [\#717](https://github.com/EMMC-ASBL/oteapi-services/pull/717) ([pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci))

app/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66

77
from __future__ import annotations
88

9-
__version__ = "1.20260421.520"
9+
__version__ = "1.20260421.522"
1010
__author__ = "SINTEF"
1111
__author_email__ = "Team4.0@SINTEF.no"

0 commit comments

Comments
 (0)