Skip to content

ci: guard upstream-only workflows behind repository check#48

Merged
LightDriverCS merged 2 commits into
mainfrom
fork/guard-upstream-only-workflows
Jun 3, 2026
Merged

ci: guard upstream-only workflows behind repository check#48
LightDriverCS merged 2 commits into
mainfrom
fork/guard-upstream-only-workflows

Conversation

@LightDriverCS

Copy link
Copy Markdown

Guards the eight upstream-only workflow families behind if: github.repository == 'openclaw/openclaw' so fork PRs stop accumulating permanent red/pending badges from checks that can never succeed here. Functional CI untouched. (Note: this PR's own board still shows those badges one final time — pull_request_target runs main's unguarded versions.)

Real behavior proof

Behavior or issue addressed: Eight workflow families inherited from upstream can never succeed on this fork — CodeQL/opengrep request Blacksmith runner pools not provisioned here, labeler/auto-response require GitHub-App secrets (apps 2729701/2971289) that don't exist in this org, and real-behavior-proof's maintainer-skip needs the same missing GH_APP_TOKEN plus a maintainer team that 404s. Every PR accumulates permanent red/pending badges, which today nearly stalled two merges.

Real environment tested: This repository's live GitHub Actions history (the real failing system), plus local YAML parsing of all eight edited workflows on this branch.

Exact steps or command run after this patch: ruby -ryaml -e "YAML.load_file(...)" across all 8 edited files; git diff --stat; and captured gh run list / gh run view --log-failed output documenting the failure modes being guarded.

Evidence after fix: Copied live output:

$ gh run list --workflow=opengrep-precise.yml --limit 5
2026-06-03T18:18  queued    -
2026-06-03T18:12  completed cancelled
2026-06-03T17:30  queued    -
2026-06-03T17:25  completed cancelled
2026-06-03T17:10  completed cancelled
$ gh run view <label job> --log-failed
Error: The 'private-key' input must be set to a non-empty string.
$ git diff --stat   (this branch)
 8 files changed, 12 insertions(+), 6 deletions(-)

CodeQL history: 8 recent runs, 0 successes (queued/cancelled/failure). All 8 edited workflows parse as valid YAML; the repo's own actionlint check validates them in this PR's CI.

Observed result after fix: With guards in place, these jobs evaluate if to false on BenchAGI/openclaw and report as skipped instead of failing/queueing forever; on upstream the condition is true and behavior is unchanged. Verifiable on the first PR after merge.

What was not tested: Upstream (openclaw/openclaw) execution of the guarded jobs — the guard preserves their condition verbatim there, and this fork cannot exercise upstream CI.

🤖 Generated with Claude Code

Cory Shelton and others added 2 commits June 3, 2026 12:50
These eight workflow families are designed for openclaw/openclaw and can
never succeed on this fork: CodeQL + opengrep want Blacksmith runner pools
not provisioned here (CodeQL 0-for-8, opengrep 0-for-5 recent completions);
labeler/auto-response need GitHub-App secrets (apps 2729701/2971289) never
provisioned; real-behavior-proof's maintainer-skip needs the same missing
GH_APP_TOKEN plus a 'maintainer' team that 404s in this org. Guard every
entry/independent job with `github.repository == 'openclaw/openclaw'` so
fork PRs stop accumulating permanent red/pending badges. Functional CI is
untouched. Standard fork-safety pattern; trivially droppable on upstream
sync.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@LightDriverCS

Copy link
Copy Markdown
Author

Anvil review status (2026-06-03): workflow-only diff looks correct, no code changes pushed by Anvil.

Verification:

  • git diff --check main...HEAD
  • python3 scripts/check-composite-action-input-interpolation.py
  • node scripts/check-no-conflict-markers.mjs
  • Workflow Sanity run 26906164109 passed, including actionlint.
  • Normal CI run 26906163961 passed: 55 success, 7 skipped.

Current blockers/noise:

  • Auto response 26906162278 and Labeler 26906162701 still fail because pull_request_target evaluates the base-branch workflow for this PR, so the new job guards cannot affect their own PR run. Both failed on missing GitHub App private key.
  • Blacksmith Testbox and Blacksmith Build Artifacts Testbox are still queued and are not touched by this PR.

GitHub documents jobs.<job_id>.if as the right repository gate and skipped jobs as success/non-blocking: https://docs.github.com/en/actions/how-tos/write-workflows/choose-when-workflows-run/control-jobs-with-conditions

Maintainer decision needed: merge/apply this self-fixing workflow guard despite the known base-workflow red checks, or apply the equivalent change directly to main.

@LightDriverCS
LightDriverCS merged commit 5a10c10 into main Jun 3, 2026
90 of 94 checks passed
LightDriverCS added a commit that referenced this pull request Jun 3, 2026
ci: guard Testbox workflows behind repository check (missed in #48)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant