Repository navigation
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the GitHub Actions release pipeline so the extension is built only when release-please actually creates a GitHub Release, and then uploads the packaged zip as a release asset.
Changes:
- Expose
release-pleaseoutputs (release_created,tag_name) and conditionally run downstream jobs only when a release is created. - Add a reusable workflow (
build-extension.yml) that builds/packages the extension and uploads a zip artifact with a versioned name. - Refactor the existing build workflow to call the reusable build workflow and remove the old “on release published” upload path.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| .github/workflows/release-please.yml | Adds conditional build + gh release upload to attach artifacts only when a release is created. |
| .github/workflows/build-extension.yml | Introduces a reusable build workflow producing a named zip artifact. |
| .github/workflows/build-artifact.yml | Refactors to reuse build-extension.yml and removes the legacy release-published upload job. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| build: | ||
| needs: release-please | ||
| if: needs.release-please.outputs.release_created == 'true' | ||
| uses: ./.github/workflows/build-extension.yml | ||
|
|
||
| upload-release: | ||
| needs: [release-please, build] | ||
| if: needs.release-please.outputs.release_created == 'true' | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| steps: |
There was a problem hiding this comment.
The reusable build job will inherit the workflow-level permissions (contents: write, pull-requests: write), which is broader than needed for a checkout/build/package. Consider setting job-level permissions (e.g., contents: read) for build and scoping write permissions only to the jobs that actually need them (release-please, upload-release) to follow least-privilege.
|
|
||
| - name: Upload release asset | ||
| run: | | ||
| gh release upload "${{ needs.release-please.outputs.tag_name }}" "dist/${{ needs.build.outputs.zip_name }}" |
There was a problem hiding this comment.
gh release upload will fail if the asset with the same filename already exists on the release (e.g., workflow re-run, or release-please re-creates the release). Consider making the upload idempotent by using the CLI's overwrite option (e.g., --clobber) or by deleting/replacing the existing asset before uploading, similar to how overwrite_files: true is used elsewhere.
| gh release upload "${{ needs.release-please.outputs.tag_name }}" "dist/${{ needs.build.outputs.zip_name }}" | |
| gh release upload --clobber "${{ needs.release-please.outputs.tag_name }}" "dist/${{ needs.build.outputs.zip_name }}" |
|
なんか動かなさそうなよくわからん差分だな... |
Release-please が release を作成したときだけビルドして、zip をそのリリースに添付します。