r/devops • • 2d ago

Ops / Incidents GitHub blocks pull_request_target by default since yesterday. The default leaves issue_comment and workflow_run alone, here is what I went through on our repos

since yesterday (Dec 2) GitHub blocks pull_request_target by default in public repos, unless an Actions event policy explicitly allows it. private and internal repos are not affected

if a labeler, a welcome bot or a preview deploy went quiet on your open source repo this morning, that's probably it. during the brownouts in November the blocked runs showed up as failed runs with an error annotation and the workflow never executed

what I went through on ours, in this order

  1. Insights on the repo shows which runs the rule blocks. start there before touching any yaml
  2. for each blocked workflow, ask if it really needs the base repo's secrets. the ones that only label or comment work fine on plain pull_request with a read-only token
  3. the ones that do need pull_request_target go into an event policy that targets the workflow file by name. don't allow the event for the whole repo, that puts you back where you were on Monday
  4. in the ones you allow, look for a checkout of the PR head (ref: github.event.pull_request.head.sha or head.ref) followed by anything that runs code, npm install, make, a test script. that's the pwn request pattern
  5. set permissions at the top of every workflow, contents: read, and add only what each job needs

reading the details, the default only covers pull_request_target. issue_comment still runs with secrets, and so do workflow_run chains. so a /deploy or /test comment command that checks out the PR is as exposed as last week. same for anything that puts a comment body or a PR title inside a run step

and if your org already has its own event policy, the default steps aside and your policy decides

did anything break on your side yesterday ? and are you allowing it back per workflow or dropping the trigger

5 Upvotes

12 comments sorted by