Skip to content

Commit f1d3ac6

Browse files
fix(build): use draft releases for VSIX upload (#338)
# Pull Request ## Description Fixes HTTP 422 error "Cannot upload assets to an immutable release" when uploading VSIX to GitHub releases. The repository has GitHub's immutable releases feature enabled, which prevents modifications to published releases. This PR: - Configures release-please to create draft releases by adding `"draft": true` at the root level of `release-please-config.json` (applies globally to all packages) - Adds a publish step in the workflow that runs after VSIX upload using `gh release edit --draft=false` **Note:** The `"draft": true` setting is placed at the root level rather than under `packages["."]` because release-please supports both locations, and root-level applies the setting globally. Since this repository has a single package, root-level placement is cleaner and functionally equivalent. ## Related Issue(s) Fixes #335 ## Type of Change Select all that apply: **Code & Documentation:** - [x] Bug fix (non-breaking change fixing an issue) - [ ] New feature (non-breaking change adding functionality) - [ ] Breaking change (fix or feature causing existing functionality to change) - [ ] Documentation update **Infrastructure & Configuration:** - [x] GitHub Actions workflow - [ ] Linting configuration (markdown, PowerShell, etc.) - [ ] Security configuration - [ ] DevContainer configuration - [ ] Dependency update **AI Artifacts:** - [ ] Reviewed contribution with `prompt-builder` agent and addressed all feedback - [ ] Copilot instructions (`.github/instructions/*.instructions.md`) - [ ] Copilot prompt (`.github/prompts/*.prompt.md`) - [ ] Copilot agent (`.github/agents/*.agent.md`) **Other:** - [ ] Script/automation (`.ps1`, `.sh`, `.py`) - [ ] Other (please describe): ## Testing - Validated workflow syntax with linting - Verified `gh release edit --draft=false` command syntax against GitHub CLI documentation - Reviewed release-please documentation confirming `draft` config option behavior at both root and package levels ## Checklist ### Required Checks - [x] Documentation is updated (if applicable) - [x] Files follow existing naming conventions - [x] Changes are backwards compatible (if applicable) - [ ] Tests added for new functionality (if applicable) ### Required Automated Checks The following validation commands must pass before merging: - [x] Markdown linting: `npm run lint:md` - [x] Spell checking: `npm run spell-check` - [x] Frontmatter validation: `npm run lint:frontmatter` - [x] Link validation: `npm run lint:md-links` - [x] PowerShell analysis: `npm run lint:ps` ## Security Considerations - [x] This PR does not contain any sensitive or NDA information - [x] Any new dependencies have been reviewed for security issues - [x] Security-related scripts follow the principle of least privilege ## Additional Notes The workflow uses the existing `github.token` which already has `contents: write` permission configured in the `publish-extension` job.
1 parent ca988f2 commit f1d3ac6

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,9 @@ jobs:
137137
exit 1
138138
fi
139139
gh release upload "${{ needs.release-please.outputs.tag_name }}" "$VSIX_FILE" --clobber -R "${{ github.repository }}"
140+
141+
- name: Publish GitHub Release
142+
env:
143+
GH_TOKEN: ${{ github.token }}
144+
run: |
145+
gh release edit "${{ needs.release-please.outputs.tag_name }}" --draft=false -R "${{ github.repository }}"

release-please-config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"draft": true,
34
"packages": {
45
".": {
56
"release-type": "node",

0 commit comments

Comments
 (0)