Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 12 additions & 20 deletions .github/workflows/update-verified-programs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,16 @@ jobs:
MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }}
run: pnpm exec tsx scripts/update-verified-programs.ts

- name: Check for changes
id: diff
run: |
git diff --exit-code public/verified-programs.json && echo "changed=false" >> $GITHUB_OUTPUT || echo "changed=true" >> $GITHUB_OUTPUT

- name: Create or update pull request
if: steps.diff.outputs.changed == 'true'
env:
GH_TOKEN: ${{ github.token }}
run: |
branch="chore/update-verified-programs"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git checkout -b "$branch"
git add public/verified-programs.json
git commit -m "chore: update verified programs list"
git push -f origin "$branch"
gh pr create \
--title "chore: update verified programs list" \
--body "Automated daily update of verified programs from OSecure." \
--base master 2>/dev/null || echo "PR already exists"
uses: peter-evans/create-pull-request@v7

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 The action is referenced by a floating semver tag (@v7) rather than an immutable commit SHA. If the tag is ever re-pointed — whether by the maintainer or a supply-chain compromise — the workflow would silently execute different code. The rest of the actions in this file follow the same pattern, but since this step now has write access (contents: write, pull-requests: write) and produces signed commits, pinning it to the exact SHA is particularly worthwhile here.

Suggested change
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@67df67e6d47fc5fe9c6b09c199bde2b88b3058ef # v7

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense

with:
token: ${{ secrets.GITHUB_TOKEN }}
sign-commits: true
commit-message: "chore: update verified programs list"
title: "chore: update verified programs list"
body: "Automated daily update of verified programs from OSecure."
branch: "chore/update-verified-programs"
base: master
add-paths: public/verified-programs.json
maintainer-can-modify: true
delete-branch: true
Loading