47 lines
1.3 KiB
YAML
47 lines
1.3 KiB
YAML
name: Heads-Up
|
|
|
|
# Flag external PRs that touch files coding agents auto-load as instructions
|
|
# (AGENTS.md, CLAUDE.md, .claude/, .agents/). Running an agent against such a
|
|
# checkout silently obeys these files, so a malicious one can steer it without
|
|
# approval. The 'heads-up' label warns reviewers to read them first.
|
|
|
|
on:
|
|
pull_request_target:
|
|
types:
|
|
- opened
|
|
- synchronize
|
|
- reopened
|
|
# Watched paths. Add new entries here to widen coverage.
|
|
paths:
|
|
- "AGENTS.md"
|
|
- "**/AGENTS.md"
|
|
- "CLAUDE.md"
|
|
- "**/CLAUDE.md"
|
|
- ".agents/**"
|
|
- ".claude/**"
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
label-heads-up:
|
|
# Only flag external contributors. Internal edits to these files are routine
|
|
# and don't need a review signal.
|
|
if: >
|
|
github.repository == 'mlflow/mlflow'
|
|
&& github.event.pull_request.user.type != 'Bot'
|
|
&& !contains(fromJson('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.pull_request.author_association)
|
|
runs-on: ubuntu-slim
|
|
timeout-minutes: 5
|
|
permissions:
|
|
pull-requests: write
|
|
steps:
|
|
- env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
REPO: ${{ github.repository }}
|
|
run: gh pr edit "$PR_NUMBER" --repo "$REPO" --add-label "heads-up"
|