Skip to content

Commit 5d55f92

Browse files
zimegClaude
andcommitted
fix: skip release workflow when triggered by its own merge
The release workflow re-triggers on main when its own PR merges, causing `make rc` to fail with "nothing to commit" since docs are already up to date. Skip the generate/PR steps when the push commit is a release commit, and make the Makefile commit conditional as a defensive fallback. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
1 parent f0e47ee commit 5d55f92

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090
echo "Bumping $LATEST_TAG to v$NEXT_VERSION"
9191
9292
- name: Generate release commit
93-
if: steps.version.outputs.has_changes == 'true'
93+
if: steps.version.outputs.has_changes == 'true' && !startsWith(github.event.head_commit.message, 'chore: release slack-cli')
9494
env:
9595
RELEASE_VERSION: ${{ steps.version.outputs.next }}
9696
run: |
@@ -100,7 +100,7 @@ jobs:
100100
git push origin "HEAD:refs/heads/rc" --force
101101
102102
- name: Create or update release PR
103-
if: steps.version.outputs.has_changes == 'true'
103+
if: steps.version.outputs.has_changes == 'true' && !startsWith(github.event.head_commit.message, 'chore: release slack-cli')
104104
env:
105105
GH_TOKEN: ${{ steps.credentials.outputs.token }}
106106
RELEASE_VERSION: ${{ steps.version.outputs.next }}

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,4 @@ rc:
102102
git add docs/guides/installing-the-slack-cli-for-mac-and-linux.md
103103
git add docs/guides/installing-the-slack-cli-for-windows.md
104104
@printf "$(FONT_BOLD)Git Commit$(FONT_RESET)\n"
105-
git commit -m "chore: release slack-cli v$(RELEASE_VERSION)"
105+
git diff --cached --quiet || git commit -m "chore: release slack-cli v$(RELEASE_VERSION)"

0 commit comments

Comments
 (0)