File tree Expand file tree Collapse file tree 2 files changed +33
-1
lines changed
Expand file tree Collapse file tree 2 files changed +33
-1
lines changed Original file line number Diff line number Diff line change 1+ # This job applies one approval automatically to the automated `flake.lock` PRs
2+ # This helps us keep up with the weekly automated PRs, but still requires at least 1
3+ # human manual approval.
4+ name : Approve flake.lock PRs (still require 1 human approval)
5+ permissions :
6+ pull-requests : write
7+ on :
8+ pull_request_target :
9+ paths :
10+ - ' flake.lock' # only run if flake.lock has changed
11+ jobs :
12+ approve-flake-lock-prs :
13+ runs-on : ubuntu-latest
14+ if : github.actor == 'github-actions[bot]' && github.event.pull_request.labels.*.name == 'flake.lock automation'
15+ steps :
16+ - uses : actions/checkout@v4
17+ - name : Approve flake.lock PRs (still requires 1 human approval)
18+ run : |
19+ # only run if only exactly 1 file is changed;
20+ # this combined with the `paths:` filter on the job itself
21+ # ensures that the PR changes ONLY flake.lock and no other files
22+ if [[ "$(git diff --name-only HEAD..origin/main | wc -l)" = 1 ]]; then
23+ gh pr review --approve "$PR_URL"
24+ end
25+ env :
26+ PR_URL : ${{github.event.pull_request.html_url}}
27+ GH_TOKEN : ${{secrets.GITHUB_TOKEN}}
Original file line number Diff line number Diff line change 3333 --field content=@<(base64 -i $FILE_TO_COMMIT) \
3434 --field branch="$COMMIT_BRANCH" \
3535 --field sha="$(git rev-parse $COMMIT_BRANCH:$FILE_TO_COMMIT)"
36- gh pr create --title "[automation]: Update Flake dependencies" --body "This is an automated PR to update \`flake.lock\`" --reviewer mrjones2014 --reviewer AndyTitu --base main --head $COMMIT_BRANCH
36+ gh pr create --title "[automation]: Update Flake dependencies" \
37+ --body "This is an automated PR to update \`flake.lock\`" \
38+ --label "flake.lock automation" \
39+ --reviewer mrjones2014 \
40+ --reviewer AndyTitu \
41+ --base main --head $COMMIT_BRANCH
3742 fi
You can’t perform that action at this time.
0 commit comments