Skip to content

Commit 3deaca8

Browse files
don't actually create a PR (#589)
1 parent b9a5f2c commit 3deaca8

File tree

2 files changed

+46
-81
lines changed

2 files changed

+46
-81
lines changed

β€Ž.github/workflows/release.yml

Lines changed: 12 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ jobs:
3939
needs: validate
4040
runs-on: ubuntu-latest
4141
outputs:
42-
pr-number: ${{ steps.create-pr.outputs.pr-number }}
43-
pr-url: ${{ steps.create-pr.outputs.pr-url }}
42+
tag: ${{ steps.tag-release.outputs.tag }}
4443

4544
steps:
4645
- name: Checkout repository
@@ -100,38 +99,12 @@ jobs:
10099
fi
101100
102101
- name: Tag the release
102+
id: tag-release
103103
run: |
104104
TAG="${{ github.event.inputs.tag }}"
105105
git tag -a "${TAG}" -m "Release ${TAG}"
106106
echo "βœ… Created tag ${TAG}"
107-
108-
- name: Create Pull Request
109-
id: create-pr
110-
run: |
111-
TAG="${{ github.event.inputs.tag }}"
112-
113-
# Create PR from next to main
114-
PR_URL=$(gh pr create \
115-
--base main \
116-
--head next \
117-
--title "Release ${TAG}" \
118-
--body "This PR contains the changes for release ${TAG}.
119-
120-
**Release checklist:**
121-
- [ ] Review the changes
122-
- [ ] Ensure all tests pass
123-
- [ ] Verify the release notes in the draft release
124-
- [ ] Merge this PR after the release is published
125-
126-
Created by the automated release workflow.")
127-
128-
PR_NUMBER=$(echo "$PR_URL" | sed 's|.*/pull/||')
129-
130-
echo "pr-number=${PR_NUMBER}" >> $GITHUB_OUTPUT
131-
echo "pr-url=${PR_URL}" >> $GITHUB_OUTPUT
132-
echo "βœ… Created PR #${PR_NUMBER}: ${PR_URL}"
133-
env:
134-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
107+
echo "tag=${TAG}" >> $GITHUB_OUTPUT
135108
136109
- name: Push tag
137110
run: |
@@ -164,8 +137,7 @@ jobs:
164137
steps:
165138
- name: Release Summary
166139
run: |
167-
TAG="${{ github.event.inputs.tag }}"
168-
PR_URL="${{ needs.release.outputs.pr-url }}"
140+
TAG="${{ needs.release.outputs.tag }}"
169141
170142
echo "## πŸŽ‰ Release $TAG has been initiated!"
171143
echo ""
@@ -174,12 +146,13 @@ jobs:
174146
echo "2. ✏️ Edit the new release, delete the existing notes and click the auto-generate button GitHub provides"
175147
echo "3. ✨ Add a section at the top calling out the main features"
176148
echo "4. πŸš€ Publish the release"
177-
echo "5. πŸ”€ Merge the pull request into main: ${PR_URL}"
178-
echo "6. Post message in #gh-mcp-releases channel in Slack and then share to the other mcp channels"
149+
echo "5. οΏ½ Create a Pull Request from 'next' to 'main' branch with title 'Release $TAG'"
150+
echo "6. οΏ½πŸ”€ Merge the pull request into main"
151+
echo "7. πŸ“’ Post message in #gh-mcp-releases channel in Slack and then share to the other mcp channels"
179152
echo ""
180153
echo "### Resources:"
181154
echo "- πŸ“¦ Draft Release: https://github.com/${{ github.repository }}/releases/tag/$TAG"
182-
echo "- πŸ”„ Pull Request: ${PR_URL}"
155+
echo "- πŸ”„ Create PR: https://github.com/${{ github.repository }}/compare/main...next"
183156
echo ""
184157
echo "The release process is now ready for your review and completion!"
185158
@@ -192,11 +165,13 @@ jobs:
192165
2. ✏️ Edit the new release, delete the existing notes and click the auto-generate button GitHub provides
193166
3. ✨ Add a section at the top calling out the main features
194167
4. πŸš€ Publish the release
195-
5. πŸ”€ Merge the pull request into main: [PR #${{ needs.release.outputs.pr-number }}](${PR_URL})
168+
5. οΏ½ [Create a Pull Request](https://github.com/${{ github.repository }}/compare/main...next) from 'next' to 'main' branch with title 'Release $TAG'
169+
6. οΏ½πŸ”€ Merge the pull request into main
170+
7. πŸ“’ Post message in #gh-mcp-releases channel in Slack and then share to the other mcp channels
196171
197172
### Resources:
198173
- πŸ“¦ [Draft Release](https://github.com/${{ github.repository }}/releases/tag/$TAG)
199-
- πŸ”„ [Pull Request](${PR_URL})
174+
- πŸ”„ [Create PR](https://github.com/${{ github.repository }}/compare/main...next)
200175
201176
The release process is now ready for your review and completion!
202177
EOF

β€Ž.github/workflows/sync-next-branch.yml

Lines changed: 34 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -77,46 +77,16 @@ jobs:
7777
env:
7878
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7979

80-
- name: Create sync PR
81-
id: create-sync-pr
80+
- name: Provide sync instructions
81+
id: sync-instructions
8282
if: steps.branch-status.outputs.needs-sync == 'true' && steps.existing-pr.outputs.has-existing-pr == 'false'
8383
run: |
8484
BEHIND_COUNT="${{ steps.branch-status.outputs.behind-count }}"
8585
AHEAD_COUNT="${{ steps.branch-status.outputs.ahead-count }}"
8686
87-
# Create PR from main to next
88-
PR_URL=$(gh pr create \
89-
--base next \
90-
--head main \
91-
--title "Sync next branch with main" \
92-
--body "## πŸ”„ Automated Branch Sync
93-
94-
This PR syncs the \`next\` branch with the latest changes from \`main\`.
95-
96-
### Status:
97-
- **Behind main**: ${BEHIND_COUNT} commits
98-
- **Ahead of main**: ${AHEAD_COUNT} commits
99-
100-
### What to do:
101-
1. πŸ” Review the changes in this PR
102-
2. βœ… Ensure all checks pass
103-
3. πŸ”€ Merge this PR to sync the \`next\` branch
104-
4. πŸ—‘οΈ The \`next\` branch will then be ready for new development
105-
106-
> **Note**: This PR was automatically created by the daily branch sync workflow.
107-
> If you have any concerns about these changes, please review them carefully before merging." \
108-
--label "automated" \
109-
--label "sync")
110-
111-
# Extract PR number from URL (e.g., https://github.com/owner/repo/pull/123 -> 123)
112-
PR_NUMBER=$(echo "$PR_URL" | sed 's|.*/pull/||')
113-
114-
echo "pr-number=${PR_NUMBER}" >> $GITHUB_OUTPUT
115-
echo "pr-url=${PR_URL}" >> $GITHUB_OUTPUT
116-
117-
echo "βœ… Created sync PR #${PR_NUMBER}: ${PR_URL}"
118-
env:
119-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87+
echo "action-needed=true" >> $GITHUB_OUTPUT
88+
echo "πŸ”„ Next branch needs syncing (${BEHIND_COUNT} commits behind main)"
89+
echo "οΏ½ Manual PR creation required due to organization policies"
12090
12191
- name: Job Summary
12292
if: always()
@@ -126,8 +96,7 @@ jobs:
12696
NEEDS_SYNC="${{ steps.branch-status.outputs.needs-sync }}"
12797
HAS_EXISTING_PR="${{ steps.existing-pr.outputs.has-existing-pr }}"
12898
EXISTING_PR="${{ steps.existing-pr.outputs.existing-pr }}"
129-
NEW_PR_URL="${{ steps.create-sync-pr.outputs.pr-url }}"
130-
NEW_PR_NUMBER="${{ steps.create-sync-pr.outputs.pr-number }}"
99+
ACTION_NEEDED="${{ steps.sync-instructions.outputs.action-needed }}"
131100
132101
cat << EOF >> $GITHUB_STEP_SUMMARY
133102
# πŸ”„ Branch Sync Status
@@ -146,15 +115,36 @@ jobs:
146115
147116
Please review and merge the existing PR to sync the next branch.
148117
EOF
149-
elif [ -n "$NEW_PR_NUMBER" ]; then
118+
elif [ "$ACTION_NEEDED" = "true" ]; then
150119
cat << EOF >> $GITHUB_STEP_SUMMARY
151-
## βœ… Action Taken:
152-
Created a new sync PR: [#${NEW_PR_NUMBER}](${NEW_PR_URL})
120+
## πŸ“ Manual Action Required:
121+
122+
The \`next\` branch is ${BEHIND_COUNT} commits behind \`main\` and needs to be synced.
123+
124+
**Please create a pull request manually:**
125+
126+
1. 🌐 [Create PR: main β†’ next](https://github.com/${{ github.repository }}/compare/next...main)
127+
2. πŸ“ Use title: **"Sync next branch with main"**
128+
3. πŸ“„ Use this description:
129+
130+
\`\`\`markdown
131+
## πŸ”„ Branch Sync
132+
133+
This PR syncs the \`next\` branch with the latest changes from \`main\`.
134+
135+
### Status:
136+
- **Behind main**: ${BEHIND_COUNT} commits
137+
- **Ahead of main**: ${AHEAD_COUNT} commits
138+
139+
### What to do:
140+
1. πŸ” Review the changes in this PR
141+
2. βœ… Ensure all checks pass
142+
3. πŸ”€ Merge this PR to sync the \`next\` branch
143+
4. πŸ—‘οΈ The \`next\` branch will then be ready for new development
144+
\`\`\`
153145
154-
**Next steps:**
155-
1. Review the changes in the PR
156-
2. Ensure all checks pass
157-
3. Merge the PR to sync the next branch
146+
4. 🏷️ Add labels: \`automated\`, \`sync\`
147+
5. βœ… Review and merge when ready
158148
EOF
159149
fi
160150
else

0 commit comments

Comments
Β (0)