From 67a44116019134e5efd7ae767f32646973b21638 Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto Date: Tue, 5 May 2026 17:04:51 +0200 Subject: [PATCH 1/2] chore: sign release version bump commits --- .github/workflows/release.yml | 37 +++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5865eca2..b7117242 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -64,8 +64,8 @@ jobs: actions: write id-token: write outputs: - committed: ${{ steps.commit-version-bump.outputs.committed }} - commit-sha: ${{ steps.commit-version-bump.outputs.commit-sha }} + committed: ${{ steps.version-bump-outputs.outputs.committed }} + commit-sha: ${{ steps.version-bump-outputs.outputs.commit-sha }} env: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 DOTNET_NOLOGO: true @@ -147,18 +147,35 @@ jobs: - name: Test run: dotnet test --configuration Release --no-build - - name: Commit version bump - id: commit-version-bump + - name: Check for version bump changes + id: check-changes run: | - git add -A - if git diff --staged --quiet; then + if [ -z "$(git status --porcelain)" ]; then echo "No changes to commit" - echo "committed=false" >> "$GITHUB_OUTPUT" - echo "commit-sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" + echo "has-changes=false" >> "$GITHUB_OUTPUT" else - git commit -m "chore: update package versions [version bump] [skip ci]" - git push origin main + echo "has-changes=true" >> "$GITHUB_OUTPUT" + fi + + - name: Commit version bump + id: commit-version-bump + if: steps.check-changes.outputs.has-changes == 'true' + uses: planetscale/ghcommit-action@25309d8005ac7c3bcd61d3fe19b69e0fe47dbdde # v0.2.20 + with: + commit_message: "chore: update package versions [version bump] [skip ci]" + repo: ${{ github.repository }} + branch: main + env: + GITHUB_TOKEN: ${{ steps.releaser.outputs.token }} + + - name: Set version bump outputs + id: version-bump-outputs + run: | + if [ "${{ steps.check-changes.outputs.has-changes }}" = "true" ]; then echo "committed=true" >> "$GITHUB_OUTPUT" + echo "commit-sha=${{ steps.commit-version-bump.outputs.commit-hash }}" >> "$GITHUB_OUTPUT" + else + echo "committed=false" >> "$GITHUB_OUTPUT" echo "commit-sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" fi From 0d996696b96b580a2ab80876ffaf2ebfa89b6077 Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto Date: Tue, 5 May 2026 17:19:46 +0200 Subject: [PATCH 2/2] chore: avoid step output interpolation in release script --- .github/workflows/release.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b7117242..5e51655e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -170,10 +170,13 @@ jobs: - name: Set version bump outputs id: version-bump-outputs + env: + HAS_CHANGES: ${{ steps.check-changes.outputs.has-changes }} + COMMIT_HASH: ${{ steps.commit-version-bump.outputs.commit-hash }} run: | - if [ "${{ steps.check-changes.outputs.has-changes }}" = "true" ]; then + if [ "$HAS_CHANGES" = "true" ]; then echo "committed=true" >> "$GITHUB_OUTPUT" - echo "commit-sha=${{ steps.commit-version-bump.outputs.commit-hash }}" >> "$GITHUB_OUTPUT" + echo "commit-sha=$COMMIT_HASH" >> "$GITHUB_OUTPUT" else echo "committed=false" >> "$GITHUB_OUTPUT" echo "commit-sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"