Skip to content

Commit 757bed1

Browse files
authored
fix(ci): create auto vscode version bump PR using GH cli (#2378)
1 parent d9caed4 commit 757bed1

2 files changed

Lines changed: 98 additions & 6 deletions

File tree

.github/workflows/update-vscode-versions.yml

Lines changed: 98 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ jobs:
128128
id: create_pr
129129
uses: peter-evans/create-pull-request@v8.1.0
130130
with:
131-
token: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }}
131+
token: ${{ secrets.GITHUB_TOKEN }}
132132
commit-message: |
133133
chore: update VS Code version window to latest 2 releases
134134
@@ -181,12 +181,108 @@ jobs:
181181
maintenance
182182
dependencies
183183
184+
- name: 💬 Create PR using GitHub CLI
185+
if: steps.check.outputs.needs_update == 'true' && steps.create_pr.outputs.pull-request-operation == 'created'
186+
env:
187+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
188+
run: |
189+
# Get the PR number from the create-pull-request action
190+
PR_NUMBER="${{ steps.create_pr.outputs.pull-request-number }}"
191+
192+
if [ -z "$PR_NUMBER" ]; then
193+
echo "No PR number found, attempting to create PR via GitHub CLI..."
194+
195+
# Create PR using gh CLI
196+
gh pr create \
197+
--repo redhat-developer/vscode-extension-tester \
198+
--head djelinek:auto-update-vscode-versions \
199+
--base main \
200+
--title "Update VS Code version window (${{ steps.versions.outputs.oldest }} - ${{ steps.versions.outputs.latest }})" \
201+
--body "## 🔄 VS Code Version Window Update
202+
203+
This PR updates the supported VS Code version window to the latest 2 stable major releases.
204+
205+
### 📊 Version Changes
206+
207+
| Position | Before | After | Status |
208+
|----------|--------|-------|--------|
209+
| **Min** | \`${{ steps.versions.outputs.current_min }}\` | \`${{ steps.versions.outputs.oldest }}\` | ✅ Updated |
210+
| **Max** | \`${{ steps.versions.outputs.current_max }}\` | \`${{ steps.versions.outputs.latest }}\` | ✅ Updated |
211+
212+
### 📝 Files Modified
213+
214+
- ✅ [\`packages/extester/package.json\`](https://github.com/redhat-developer/vscode-extension-tester/blob/auto-update-vscode-versions/packages/extester/package.json) - Updated \`vscode-min\` and \`vscode-max\`
215+
216+
### 🧪 Testing
217+
218+
CI will automatically test against both versions:
219+
- ✅ Min: \`${{ steps.versions.outputs.oldest }}\`
220+
- ✅ Max: \`${{ steps.versions.outputs.latest }}\`
221+
222+
### ✅ Review Checklist
223+
224+
- [ ] All CI tests pass for both versions
225+
- [ ] No breaking changes detected in test results
226+
- [ ] Page objects still work across all versions
227+
- [ ] Ready to merge and release
228+
229+
### 📦 Next Steps After Merge
230+
231+
1. ✅ Verify all tests passed
232+
2. 🚀 Trigger release workflow if needed
233+
3. 📚 Update documentation if there are breaking changes
234+
235+
---
236+
237+
🤖 *This PR was automatically created by the [version update workflow](https://github.com/redhat-developer/vscode-extension-tester/actions/workflows/update-vscode-versions.yml)*" \
238+
--label automation,maintenance,dependencies || echo "PR creation failed or already exists"
239+
fi
240+
184241
- name: 💬 Comment on PR with test instructions
185242
if: steps.check.outputs.needs_update == 'true' && steps.create_pr.outputs.pull-request-number
243+
env:
244+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
245+
run: |
246+
gh pr comment ${{ steps.create_pr.outputs.pull-request-number }} \
247+
--repo redhat-developer/vscode-extension-tester \
248+
--body "## 🧪 Testing Instructions
249+
250+
The CI pipeline will automatically test both versions. Monitor the test results in the checks below.
251+
252+
### 🔍 What to Review
253+
254+
- ✅ Check that all CI tests pass
255+
- ⚠️ Look for any failures or warnings in test output
256+
- 📸 Review screenshots if any tests fail
257+
- 🐛 Check for breaking changes in page objects
258+
259+
### 🛠️ Manual Testing (Optional)
260+
261+
If you want to test locally before merging:
262+
263+
\`\`\`bash
264+
# Test with min version
265+
CODE_VERSION=min npm test
266+
267+
# Test with max version
268+
CODE_VERSION=max npm test
269+
\`\`\`
270+
271+
### ✅ Ready to Merge?
272+
273+
If all tests pass and there are no breaking changes, this PR is ready to merge! 🎉
274+
275+
After merging, consider:
276+
1. Creating a new release with the updated version support
277+
2. Updating documentation if needed
278+
3. Announcing the new supported versions"
279+
280+
- name: ⚠️ Notify on failure (legacy)
281+
if: failure()
186282
uses: actions/github-script@v8
187283
with:
188284
script: |
189-
github.rest.issues.createComment({
285+
github.rest.issues.create({
190286
owner: context.repo.owner,
191287
repo: context.repo.repo,
192288
issue_number: ${{ steps.create_pr.outputs.pull-request-number }},
@@ -259,5 +355,3 @@ jobs:
259355
🤖 *This issue was automatically created by the version update workflow*`,
260356
labels: ['automation', 'bug', 'maintenance']
261357
})
262-
263-
# Made with Bob

scripts/test-version-update.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,5 +138,3 @@ else
138138
echo " - Versions are up to date"
139139
echo " - The workflow will check again next Monday"
140140
fi
141-
142-
# Made with Bob

0 commit comments

Comments
 (0)