ci(lint): limit renovate pull requests to pin and version lines
scripts/check_bot_pr_diff.py fails a pull request from a renovate/ branch that touches anything but version, tag, digest and image pin lines, so the automerge of bot pull requests cannot alter workflow logic or reach the org secrets. Wired as a pull-request-only step of the lint workflow. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
This commit is contained in:
1 parent
359e016307
commit
f2e1139562
3 files changed
+371
No files matched your search
@@ -84,6 +84,19 @@ jobs:
|
||||
export PATH="/opt/venv/bin:$PATH"
|
||||
python3 scripts/check_image_versions.py bump origin/main
|
||||
|
||||
# A pull request from a renovate/ branch may only move version, tag, digest and pin
|
||||
# lines (scripts/check_bot_pr_diff.py), so the bot's automerge cannot change workflow
|
||||
# logic or reach the org secrets. The branch name is attacker-controlled: this only
|
||||
# constrains the bot's own pull requests. The refs go through env:, never into run:.
|
||||
- name: Check a bot pull request only moves pins
|
||||
if: github.event_name == 'pull_request'
|
||||
env:
|
||||
HEAD_REF: ${{ github.head_ref }}
|
||||
BASE_REF: origin/main
|
||||
run: |
|
||||
export PATH="/opt/venv/bin:$PATH"
|
||||
python3 scripts/check_bot_pr_diff.py "$HEAD_REF" "$BASE_REF"
|
||||
|
||||
- name: Test the repository scripts
|
||||
run: |
|
||||
export PATH="/opt/venv/bin:$PATH"
|
||||
|
||||
Reference in new issue
Block a user