-
-
Notifications
You must be signed in to change notification settings - Fork 905
fix[ci]: harden workflow trust boundaries #5003
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
Open
banteg
wants to merge
14
commits into
vyperlang:master
Choose a base branch
from
banteg:feat/ci-audit-fixes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
8838e58
fix[ci]: split benchmark comments from measurement
banteg c529c79
fix[ci]: harden release publishing jobs
banteg ef86849
fix[ci]: restrict coverage token to trusted pushes
banteg c6de265
fix[ci]: pin remaining workflow dependencies
banteg 0976a83
fix(ci): update pinned action versions
banteg f7815da
fix[ci]: bound workflow job runtimes
banteg aa92a4b
Merge branch 'master' into feat/ci-audit-fixes
harkal 9994c39
Merge branch 'master' into feat/ci-audit-fixes
harkal 662f385
fix[ci]: resolve benchmark comment PRs from forks
banteg 7bce557
Merge branch 'master' into feat/ci-audit-fixes
harkal aa47aa1
fix[ci]: pin era tester python version
banteg d330b69
fix[ci]: centralize workflow python versions
banteg 5e04cae
fix[ci]: standardize workflows on python 3.12
banteg b5914eb
fix[ci]: group dependabot action updates
banteg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: "github-actions" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" | ||
| cooldown: | ||
| default-days: 7 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| name: Bytecode Size PR Comment | ||
|
|
||
| on: | ||
| workflow_run: # zizmor: ignore[dangerous-triggers] Comment-only follow-up; never checks out or executes PR code. | ||
| workflows: ["Bytecode Size Report"] | ||
| types: [completed] | ||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| comment: | ||
| if: > | ||
| github.event.workflow_run.conclusion == 'success' && | ||
| github.event.workflow_run.event == 'pull_request' && | ||
| github.event.workflow_run.pull_requests[0].number != null | ||
|
harkal marked this conversation as resolved.
Outdated
|
||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| # Download the report artifact from the completed measurement run. | ||
| actions: read | ||
| # Required by artifact download and workflow run metadata reads. | ||
| contents: read | ||
| # Update only the benchmark report comment on the pull request. | ||
| pull-requests: write | ||
| steps: | ||
| - name: Download report | ||
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||
| with: | ||
| name: bytecode-size-report | ||
| path: report | ||
| run-id: ${{ github.event.workflow_run.id }} | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Post or update PR comment | ||
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 | ||
| with: | ||
| script: | | ||
| const fs = require('fs'); | ||
| const marker = '<!-- bytecode-size-report -->'; | ||
| const report = fs.readFileSync('report/report.md', 'utf8'); | ||
| const body = marker + '\n\n' + report; | ||
| const issue_number = context.payload.workflow_run.pull_requests[0].number; | ||
| const comments = await github.paginate(github.rest.issues.listComments, { | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number | ||
| }); | ||
| const existing = comments.find(c => c.body.includes(marker)); | ||
| if (existing) { | ||
| return github.rest.issues.updateComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| comment_id: existing.id, | ||
| body | ||
| }); | ||
| } | ||
| await github.rest.issues.createComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number, | ||
| body | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.