-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Instead Auto-update SRI hash when a change lands on main, file a PR
This should ensure that dependabot PRs can land (because their SRI hash doesn't get checked), while still ensuring that the SRI hash doesn't get forgotten.
- Loading branch information
Showing
3 changed files
with
55 additions
and
70 deletions.
There are no files selected for viewing
This file contains 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,55 @@ | ||
# This action is suuuuper ripped off from tailscale's: | ||
# https://github.com/tailscale/tailscale/blob/main/.github/workflows/update-flake.yml | ||
|
||
name: "File PR for updated SRI hash" | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- go.mod | ||
- go.sum | ||
- .github/workflows/auto_update_sri_pr.yml | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
update_sri_hash: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Generate token | ||
id: generate-token | ||
uses: tibdex/github-app-token@v1 | ||
with: | ||
app_id: ${{ vars.PR_FIXUP_APP_ID }} | ||
private_key: ${{ secrets.PR_FIXUP_APP_PRIVATE_KEY }} | ||
- uses: actions/checkout@v3.5.3 | ||
with: | ||
token: ${{secrets.REPO_CONTENT_UPDATE_TOKEN}} | ||
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo | ||
- name: Cache install Nix packages | ||
uses: mtoohey31/cache-flake-attrs@v2 | ||
with: | ||
key: ${{ runner.os }}-nix-${{ hashFiles('./flake.nix') }} | ||
flake_paths: ".#regenSRI" | ||
- name: re-generate SRI | ||
run: "nix --extra-experimental-features nix-command --extra-experimental-features flakes run .#regenSRI" | ||
|
||
- name: File pull request | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
token: ${{ steps.generate-token.outputs.token }} | ||
author: Flakes Updater <noreply+flakes-updater@boinkor.net> | ||
committer: Flakes Updater <noreply+flakes-updater@boinkor.net> | ||
branch: auto-update-sri | ||
commit-message: "tsnsrv.sri: update SRI hash for go module changes" | ||
title: "tsnsrv.sri: update SRI hash for go module changes" | ||
body: Triggered by ${{ github.repository }}@${{ github.sha }} | ||
signoff: true | ||
delete-branch: true | ||
reviewers: antifuchs |
This file was deleted.
Oops, something went wrong.
This file contains 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