-
Notifications
You must be signed in to change notification settings - Fork 359
ci: add a v3 release workflow #3343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,85 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Release v3 version | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| on: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| workflow_dispatch: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| validate-branch: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Validate Branch | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Ensure running on vibe3 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: github.ref != 'refs/heads/vibe3' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "::error::Release v3 workflow must be triggered from the vibe3 branch. Current branch: ${{ github.ref }}" | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exit 1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| notify-release-start: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Notify Slack - Release Started | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs: validate-branch | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| continue-on-error: true | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Send Slack notification | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: fjogeleit/http-request-action@v1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| url: ${{ secrets.SLACK_DEV_TEAM_WEBHOOK_URL }} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| method: "POST" | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| contentType: "application/json" | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| data: | | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "event": "v3_release_started", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "actor": "${{ github.actor }}", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "commit_id": "${{ github.sha }}", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "workflow": "${{ github.workflow }}", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "run_url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "commit_url": "${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}" | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| build: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+18
to
+39
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
Copilot AutofixAI 3 days ago In general, the fix is to explicitly define For this specific file, the simplest least-disruptive fix is:
Concretely:
No additional imports or external packages are needed; this is configuration-only.
Suggested changeset
1
.github/workflows/release-v3.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Build | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs: validate-branch | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: ./.github/workflows/build-and-upload.yml | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| secrets: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| npm_token: ${{ secrets.npm_token }} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| test: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+40
to
+46
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
Copilot AutofixAI 3 days ago In general, the fix is to explicitly declare For this specific workflow in
permissions:
contents: readThis will apply to all jobs by default.
No imports or additional methods are required, as this is pure YAML configuration. The main changes are: (1) insert a
Suggested changeset
1
.github/workflows/release-v3.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Test | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs: build | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: ./.github/workflows/test.yml | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| has_changes: ${{ needs.build.outputs.has_changes }} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| secrets: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| npm_token: ${{ secrets.npm_token }} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| release: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+47
to
+55
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
Copilot AutofixAI 3 days ago In general, the fix is to add an explicit For this workflow, a good, non‑breaking approach is:
Concretely:
No imports or external libraries are involved; we only adjust YAML configuration inside this workflow file.
Suggested changeset
1
.github/workflows/release-v3.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Release | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs: [build, test] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ needs.build.outputs.has_changes == 'true' }} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| NODE_AUTH_TOKEN: ${{ secrets.npm_token }} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| token: ${{ secrets.VIBE_GITHUB_TOKEN }} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fetch-depth: 0 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Run Setup | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: ./.github/actions/setup | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| npm_token: ${{ secrets.npm_token }} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - uses: ./.github/actions/git-creds | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - uses: ./.github/actions/download-builds | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Generate new versions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: yarn lerna version --exact --conventional-commits --message "Publish [skip ci]" -y --create-release github | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GH_TOKEN: ${{ secrets.VIBE_GITHUB_TOKEN }} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - run: yarn config set registry https://registry.npmjs.org/ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Setup .npmrc for publish | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id: setup-npmrc | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" > .npmrc | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Publish to npm with v3 dist-tag | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: yarn lerna publish from-package --dist-tag v3 --dry-run -y | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+81
to
+82
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1. Dry-run blocks publishing The v3 release workflow runs yarn lerna publish with --dry-run, so it can succeed without actually publishing any packages to npm. This makes the workflow non-functional as a release pipeline. Agent Prompt
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Remove .npmrc | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: steps.setup-npmrc.outcome == 'success' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: rm .npmrc | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+56
to
+85
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Copilot AutofixAI 3 days ago In general, the fix is to add an explicit Concretely, edit permissions:
contents: readNo imports or new methods are needed; this is purely a YAML configuration change to the workflow file.
Suggested changeset
1
.github/workflows/release-v3.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 3 days ago
In general, this issue is fixed by explicitly declaring a minimal
permissions:block for the workflow or for individual jobs, instead of inheriting the repository/org defaults. For most workflows that only need to read repository contents,contents: readis a safe baseline; jobs that create releases or otherwise write to the repo can be given the narrowercontents: writeor specific scopes as needed.For this workflow, the best minimally-invasive fix is:
permissions:block settingcontents: readso that all jobs default to read-only access.permissionsfor thereleasejob, which creates GitHub releases and likely needs to write release data and possibly tags, by settingcontents: write. This grants that job the rights it needs while keeping others restricted.permissions:block aftername:and beforeon:for clarity and to follow common conventions.No extra imports or external libraries are needed; this is purely a YAML configuration change inside
.github/workflows/release-v3.yml.