-
Notifications
You must be signed in to change notification settings - Fork 359
ci: add a v3 release workflow #3329
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
Changes from 80 commits
fd1c1c7
853dd0d
76e52d9
3f46cbf
b69ab5a
57d9644
804190a
dc031ba
ee9ba03
1e37c32
76232a1
bf9752a
b526203
7040c08
58619c6
1864120
413147e
253235d
d425ea7
6781ee5
0562c35
bc98f26
52501bf
22f7f71
ec31b19
f9364e8
9176948
30279bf
cdcae41
dca47d6
fcb0bf0
ec10fb2
5df39ae
deb39ea
9158df3
c3bdba8
f4392c9
02d8431
80dcdf3
872e7bf
92d182a
f423be2
0540786
9599a88
7e49637
b7b3922
9ecc82f
0f68dee
e5695c0
10f2872
61d2da8
05380b5
e870562
d864c05
10e8847
1e1755b
8885f48
b504327
dbc964a
062758e
5959d66
012726e
ac5a191
f305f32
f7ca751
fdc4dab
5ce5987
71f526c
1ac7609
49187f2
3bc2c6b
01832ac
8c8df23
3e6ed76
36faa70
a457b8c
5ee54fe
b68de2f
8074005
5d04fb2
39c0646
39b4f99
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 9 days ago In general, to fix this issue you should explicitly declare a For this specific alert on Concretely:
permissions:
contents: readbetween
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 9 days ago In general, the fix is to add an explicit The best minimal change here is:
Concretely:
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 9 days ago In general: Add an explicit Best concrete fix for this file:
All needed changes are within
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. Publish is dry-run release-v3.yml runs yarn lerna publish ... --dry-run, so no packages are actually published even though the workflow also bumps versions and creates a GitHub release, leaving the repo/releases ahead of npm. This can produce a broken release state where consumers cannot install the released versions. 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 9 days ago To fix the problem, explicitly define The simplest and safest change without altering functionality is:
No additional imports or dependencies are required; this is purely a YAML configuration change within
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 9 days ago
In general, fix this by adding an explicit
permissionsblock that grants only the minimal scopes needed. You can set a restrictivepermissionsblock at the workflow root (applies to all jobs) and then override it per job where additional permissions are necessary.For this specific workflow:
permissionsblock aftername:(or afteron:) with the minimal sensible default, e.g.contents: read. This is safe for jobs that don’t need to modify the repo or PRs.validate-branch: it only checksgithub.refand prints an error; it does not useGITHUB_TOKENat all. It can either inheritcontents: reador, more strictly, override withpermissions: {}to disable the token entirely.notify-release-start: it calls an HTTP webhook using a secret and does not interact with the GitHub API; inheritingcontents: readis fine, but it also could usepermissions: {}. To keep the configuration simple, letting it inherit read-only is acceptable and still follows least-privilege relative to defaults.buildandtest: they areuses:-reusable workflows. Their inner permissions are defined in their own files; this file only needs enough permission for needs/outputs, which does not require extra scopes beyond read of repo metadata. Let them inheritcontents: read.release: this job checks out the repository, creates versions and GitHub releases (lerna version --create-release github), and usesVIBE_GITHUB_TOKEN. Creating releases requirescontents: write; it may also needpull-requests: writeif it manipulates PRs (not visible here), but we can safely grantcontents: writewhich covers creating tags and releases. So add a per-jobpermissionsblock withcontents: write(and optionally other specific scopes if later required) overriding the read-only default.All required changes are in
.github/workflows/release-v3.yml:permissions:block (e.g., after theon:block) withcontents: read.permissions: {}block in thevalidate-branchjob to fully disableGITHUB_TOKENfor that job.permissions:block for thereleasejob that setscontents: write.No new imports or external libraries are needed, as this is a YAML workflow configuration change only.