Skip to content

ci: [REUSABLE HARNESS — DO NOT MERGE] middle branch to test pull_request_target workflows - #90

Draft
krlmlr wants to merge 1 commit into
mainfrom
claude/ubuntu-26-arm64-gha-ezzy7y-fmt-base
Draft

ci: [REUSABLE HARNESS — DO NOT MERGE] middle branch to test pull_request_target workflows#90
krlmlr wants to merge 1 commit into
mainfrom
claude/ubuntu-26-arm64-gha-ezzy7y-fmt-base

Conversation

@krlmlr

@krlmlr krlmlr commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

⚠️ DO NOT MERGE — reusable "middle" branch for testing pull_request_target workflows (e.g. format-suggest)

Testing a change to a pull_request_target workflow from a PR is normally impossible: pull_request_target always runs the workflow file from the repo's default branch (main), never the PR's branch. This branch is the workaround's middle layer; the outermost test PR is #91.

How it works

It switches format-suggest to a pull_request trigger (which does use the PR's own workflow file) scoped to branches: [<this branch>], and drops the fork-only if. Effect:

How a future session reuses this

Per-reuse change is the branch-name token (claude/ubuntu-26-arm64-gha-ezzy7y-fmt-base).

  1. Create a middle branch <NEW>-fmt-base from main.
  2. Apply this branch's format-suggest.yaml edit, then point its branches filter at the new name:
    sed -i 's#claude/ubuntu-26-arm64-gha-ezzy7y-fmt-base#<NEW>-fmt-base#g' .github/workflows/format-suggest.yaml
  3. Push; open a draft PR (base main) — it runs no checks. Then stack the outermost test PR on it (see ci: [REUSABLE HARNESS — DO NOT MERGE] outermost PR that exercises format-suggest end-to-end #91).

The real format-suggest on main keeps pull_request_target + fork-only; this pull_request switch is test-only. DO NOT MERGE.

🤖 Generated with Claude Code

@krlmlr
krlmlr force-pushed the claude/ubuntu-26-arm64-gha-ezzy7y-fmt-base branch from c7e853a to 38c0abd Compare July 22, 2026 09:47
@krlmlr
krlmlr changed the base branch from claude/ubuntu-26-arm64-gha-ezzy7y to main July 22, 2026 15:14
@krlmlr krlmlr changed the title ci: [DO NOT MERGE] middle branch — enable format-suggest for testing ci: [REUSABLE HARNESS — DO NOT MERGE] middle branch to test pull_request_target workflows Jul 22, 2026
Makes format-suggest testable via a PR. The real workflow uses
pull_request_target, which runs the DEFAULT branch's (main) workflow file, so a
modified format-suggest cannot be exercised from a PR without touching main.

This middle branch switches format-suggest to a `pull_request` trigger (which
uses the PR's own workflow file) scoped to PRs whose base is this middle branch.
Effect:
- The outermost PR (base = this branch) triggers format-suggest -> runs its
  style + reviewdog logic end-to-end.
- This middle PR (base = the feature branch) does NOT match the branches filter,
  so it triggers no checks.

The fork-only `if` gate is dropped so the same-repo test PR runs. DO NOT MERGE.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Tw1nB3SzehmtvTjkwmc2v
@krlmlr
krlmlr force-pushed the claude/ubuntu-26-arm64-gha-ezzy7y-fmt-base branch from 38c0abd to 72f0ea5 Compare July 22, 2026 17:01
@krlmlr

krlmlr commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants