Skip to content

Skip pull requests from forks and stop rewriting the SDLC labels - #14

Merged
adriaandotcom merged 2 commits into
mainfrom
codex/sdlc-label-forks
Nov 18, 2026
Merged

adriaandotcom merged 2 commits into
mainfrom
codex/sdlc-label-forks

Conversation

@simpleanalytics-agent

@simpleanalytics-agent simpleanalytics-agent commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes simpleanalytics/dashboard#1121

Every pull request from a fork failed pull-request / sdlc-label, for example wordpress-plugin#64 (run).

  • Replaces the Ensure SDLC labels step with Create missing SDLC labels. The old step rewrote the color and description of both labels on every run, and that rewrite returned the 403 on fork pull requests. The new step only reads the labels and creates one with its color and description when the repository does not have it yet.
  • Skips the job when the head repository is not the base repository. Those runs get no ANTHROPIC_API_KEY and a read-only token, so even without the 403 the Claude step would fail, and labeling, commenting, and requesting reviewers would return 403 too. GitHub reports a skipped job as passing.
  • The README says fork pull requests are labeled by hand, including requesting a reviewer for change: needs review.

Pull requests from branches in the same repository run as before, except that existing labels are no longer rewritten.

Security implications

  • No security impact
  • Has security impact - described as:

Tokens, secrets, and permissions are unchanged. Fork pull requests no longer get an automatic label or review request, so a maintainer sets those by hand.

Testing

  • node --test test/*.mjs: 38 tests pass. The trigger test now covers opened and labeled fork pull requests and fails against the workflow on main. A new test covers creating a missing label, leaving an existing one alone, and failing on other errors.
  • actionlint 1.7.12 passes for pull-request.yml and pull-request-checks.yml; git diff --check passes.
  • After merging: rerun the failed check of wordpress-plugin#64 and confirm sdlc-label is skipped.

Summary by CodeRabbit

  • Workflow Updates

    • Risk-label automation now runs only for pull requests opened from the repository itself. Pull requests from forks are skipped and may need labels added manually.
    • Missing SDLC labels are created when needed; existing labels are left unchanged.
  • Documentation

    • README guidance explains how to handle skipped fork pull requests, including manual labeling and requesting a reviewer.

Pull requests from forks get a read-only token and no secrets, so the
label step failed with a 403 and Claude could not classify them. The
labels already exist, and adding a label creates it when missing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The risk-label job now runs only for pull requests from the workflow repository. The label step creates missing SDLC labels without changing existing labels. Tests cover both behaviors, and the README explains manual labeling for fork pull requests.

Changes: Risk-label workflow policy

Layer / File(s) Summary
Restrict risk-label workflow execution
.github/workflows/pull-request.yml, test/pull-request-policy.test.mjs, README.md
The job condition requires the pull request head repository to match the workflow repository. Tests cover fork opened and labeled events. The README instructs users to label fork pull requests manually and request a reviewer when needed.
Create missing SDLC labels
.github/workflows/pull-request.yml, test/pull-request-policy.test.mjs
The label step creates a label only when its lookup returns 404. It leaves existing labels unchanged and propagates other errors. Tests cover creation, an existing label, and a 403 lookup error.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

Suggested reviewers: adriaandotcom

Merge Risk: Minimal · up to b8d74

This change stops the risk-label check from failing on fork pull requests and no longer rewrites existing labels. Same-repository pull requests behave as before. Tests cover the new behavior, so merge-readiness risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names two changes that are both in the changeset: the sdlc-label job now skips pull requests from forks (head repository differs from base), and the label step no longer rewrites existing SD…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names two changes that are both in the changeset: the sdlc-label job now skips pull requests from forks (head repository differs from base), and the label step no longer rewrites existing SDLC labels (it creates only missing ones). Both are the main changes the PR objectives describe. The title is concise, specific, and does not use vague terms.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: QUIET
  • Plan: Team
  • Run ID: fa71503f-1de6-4c72-9a2c-5ec1ecdb1fc6
Commits

Reviewing files that changed from the base of the PR and between 79046e7 and b8d74b0.

Files selected for processing: 2

  • .github/workflows/pull-request.yml
  • test/pull-request-policy.test.mjs

Included review availability: This review used your included allowance. 4 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 8 reviews per hour.

@github-actions github-actions Bot added the change: routine Routine or ordinary change that needs at most one human or AI-assisted review label Nov 18, 2026
@github-actions

Copy link
Copy Markdown

SDLC label: change: routine because The change skips the SDLC classification job for pull requests from forks, which only restricts who can trigger it, and removes a label-creation step, so no personal data, credentials, or security boundaries are affected in this non-critical workflow repository.

Existing labels keep their color and description, so the step only
reads them and needs no write access when the labels exist.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adriaandotcom
adriaandotcom merged commit d3998a8 into main Nov 18, 2026
2 checks passed
@adriaandotcom
adriaandotcom deleted the codex/sdlc-label-forks branch November 18, 2026 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change: routine Routine or ordinary change that needs at most one human or AI-assisted review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants