|
12 | 12 |
|
13 | 13 | permissions: |
14 | 14 | contents: write |
| 15 | + pull-requests: write |
15 | 16 |
|
16 | 17 | jobs: |
17 | 18 | bump-version: |
@@ -98,29 +99,32 @@ jobs: |
98 | 99 | echo "old_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT |
99 | 100 | echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT |
100 | 101 |
|
101 | | - - name: Commit version bump |
| 102 | + - name: Create version bump PR |
| 103 | + env: |
| 104 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
102 | 105 | run: | |
103 | 106 | # Check if there are any changes to commit |
104 | 107 | if git diff --quiet; then |
105 | 108 | echo "No version changes to commit" |
106 | 109 | exit 0 |
107 | 110 | fi |
108 | 111 |
|
109 | | - # Add version files and changelog |
110 | | - git add .claude-plugin/plugin.json .claude-plugin/marketplace.json CHANGELOG.md |
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" |
| 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}" |
116 | 115 |
|
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 |
| 116 | + # Create branch, commit, and push |
| 117 | + git checkout -b "$BRANCH" |
| 118 | + 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 |
0 commit comments