Skip to content

ci(fork): accept same-repo PRs into the fork release line as a correct target - #27

Merged
vadymhimself merged 1 commit into
devfrom
gauge/guard-allow-release-line
Nov 15, 2026
Merged

vadymhimself merged 1 commit into
devfrom
gauge/guard-allow-release-line

Conversation

@vadymhimself

Copy link
Copy Markdown
Collaborator

Summary: PRs into this fork's release line (release/<semver>-vadymhimself.<n>) from branches in this same repository are accepted as a correct target: no wrong_base failure, no [WRONG BRANCH] title prefix, no auto-draft.

Why: pull_request_target runs the default branch's copy of this workflow for every PR, whatever its base. The release line's own release/* allowance therefore never ran: #18, #24, #25 and #26 were all flagged wrong-base and re-drafted about 20 seconds after each ready-for-review.

Scope: only a same-repo head into an exact release/<semver>-vadymhimself.<n> base. PRs from other repositories and lookalike bases stay wrong_base. Every other rule is unchanged. It takes effect once the default branch (main) carries this commit.

Tests: new tests/ci-workflows/enforce-pr-target-release-line.test.ts 9/9; it fails 1 of 9 on the old workflow (the same-repo release-line case). ci-workflows.test.ts 136/136, repo-hygiene.test.ts 14/14, .github/scripts/enforce-pr-target.test.cjs 20/20. Known red not from this PR: release-version-line on dev (2.43.0 is behind the fork tag .21).

Eval added/updated: a same-repo PR into release/2.65.0-vadymhimself.15 passes the gate; a PR from another repository and 7 lookalike bases are still flagged.

🤖 Generated with Claude Code

@github-actions

Copy link
Copy Markdown

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the chore label Nov 15, 2026
@vadymhimself

Copy link
Copy Markdown
Collaborator Author

independent-qa + ci-files-sec (Mars): GREEN at 57d6e9720d8f305b200092bf88338d3f903d7e76

Read: the enforce-pr-target.yml diff (+16/-2), in context of the whole file at this head, and the new test file.

Allowed path: a PR counts as a correct target when its base matches ^release/\d+\.\d+\.\d+-vadymhimself\.\d+$ (anchored at both ends) and its head repo is this same repo: pr.head.repo.owner.login and .name against context.repo (:264). Pushing such a branch already needs write access to this repo. The same widened list is passed to collectPrQualityFailures only in that case. The test covers it: no title change, no draft, "All PR quality gates passed".

Refusal path:

  • A PR from another repo into the release line stays wrong_base, is re-drafted and gets its title prefixed (tested).
  • 7 lookalike bases (no .n, an extra suffix, a different owner tag, a short semver, an x prefix, release/maintenance) all stay wrong_base (tested).
  • A deleted head repo gives pr.head.repo null, which reads as false through ?..

Unchanged and still safe:

  • The pull_request_target job still checks out only the trusted base (dev/main, :168, pinned actions/checkout@11bd719), never PR code.
  • Permissions are unchanged.
  • No PR-controlled value is newly interpolated into a script.

Takes effect only from main: GitHub runs this workflow from the default branch. When main is fast-forwarded, it should land exactly on dev's merge of #27; any other commit riding along needs its own review. A new push voids this GREEN.

@vadymhimself

Copy link
Copy Markdown
Collaborator Author

independent-qa + ci-files-sec (Mars): GREEN at 8f13b48e17e01c4e43692b2a5d7e30b077bcd88b (re-stamp of my GREEN at 57d6e97)

The one new commit (ahead 1, behind 0) adds only "enforce-pr-target-release-line.test.ts": "ci-workflows" to scripts/test-layout/layout.json and tests/fixtures/test-layout-expected.json, one line each in sorted position. The workflow and the test are byte-for-byte what I approved. The three remaining reds (release-version-line, the privacy scan on docs/claude-routed-cache-investigation.md, and the gui gates) come from the dev tree, not from this PR. Whether to merge with them is Liza's call. The main fast-forward should land exactly on dev's merge of #27. A new push voids this GREEN.

…t target

Rebased on dev after #28. Same two changes as the QA-approved head
8f13b48: the release-line allowance in enforce-pr-target.yml with its
test, and the test's entry in the tests/ layout tables.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vadymhimself
vadymhimself force-pushed the gauge/guard-allow-release-line branch from 8f13b48 to 6c5e60a Compare November 15, 2026 01:45
@vadymhimself

Copy link
Copy Markdown
Collaborator Author

independent-qa + ci-files-sec (Mars): GREEN at 6c5e60aafdfb849fe2ab51fde3654dbde325f1fb (re-stamp after the rebase onto dev 47e8303)

The PR shows the same 4 files against dev, and each blob sha is identical to my approved head 8f13b48:

  • the workflow 8ee7f9e3
  • the new test c4c7197d
  • layout.json 460a840c
  • test-layout-expected.json 73c7914f

#28 touched none of them. Merge once CI is green at this sha. Then main moves to exactly dev's merge commit of #27. A new push voids this GREEN.

@vadymhimself
vadymhimself merged commit 5e04d4f into dev Nov 15, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant