|
12 | 12 |
|
13 | 13 | permissions: |
14 | 14 | contents: write |
15 | | - pull-requests: write |
16 | 15 |
|
17 | 16 | jobs: |
18 | 17 | bump-version: |
@@ -99,32 +98,29 @@ jobs: |
99 | 98 | echo "old_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT |
100 | 99 | echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT |
101 | 100 |
|
102 | | - - name: Create version bump PR |
103 | | - env: |
104 | | - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 101 | + - name: Commit version bump |
105 | 102 | run: | |
106 | 103 | # Check if there are any changes to commit |
107 | 104 | if git diff --quiet; then |
108 | 105 | echo "No version changes to commit" |
109 | 106 | exit 0 |
110 | 107 | fi |
111 | 108 |
|
112 | | - OLD_VERSION="${{ steps.bump-version.outputs.old_version }}" |
113 | | - NEW_VERSION="${{ steps.bump-version.outputs.new_version }}" |
114 | | - BRANCH="chore/bump-version-${NEW_VERSION}" |
115 | | -
|
116 | | - # Create branch, commit, and push |
117 | | - git checkout -b "$BRANCH" |
| 109 | + # Add version files and changelog |
118 | 110 | git add .claude-plugin/plugin.json .claude-plugin/marketplace.json CHANGELOG.md |
119 | | - git commit -m "chore(plugin): bump version ${OLD_VERSION} -> ${NEW_VERSION} [skip ci]" |
120 | | - git push origin "$BRANCH" |
121 | | -
|
122 | | - # Create PR and admin-merge (bypasses branch protection) |
123 | | - PR_URL=$(gh pr create \ |
124 | | - --title "chore(plugin): bump version ${OLD_VERSION} -> ${NEW_VERSION}" \ |
125 | | - --body "Automated version bump based on conventional commit analysis." \ |
126 | | - --base main \ |
127 | | - --head "$BRANCH") |
128 | | -
|
129 | | - echo "Created PR: $PR_URL" |
130 | | - gh pr merge "$PR_URL" --merge --admin --delete-branch |
| 111 | +
|
| 112 | + # Create commit message |
| 113 | + COMMIT_MSG="chore(plugin): bump version ${{ steps.bump-version.outputs.old_version }} -> ${{ steps.bump-version.outputs.new_version }} [skip ci]" |
| 114 | +
|
| 115 | + git commit -m "$COMMIT_MSG" |
| 116 | +
|
| 117 | + # Pull latest and rebase, handling conflicts gracefully |
| 118 | + if ! git pull --rebase origin main; then |
| 119 | + echo "Rebase conflict detected - another workflow likely pushed first" |
| 120 | + echo "Aborting rebase and exiting cleanly (next push will retry)" |
| 121 | + git rebase --abort 2>/dev/null || true |
| 122 | + exit 0 |
| 123 | + fi |
| 124 | +
|
| 125 | + # Push the rebased commit |
| 126 | + git push origin main |
0 commit comments