Repository navigation
ci: guard publish, release, deploy and badge jobs to the upstream repository - #51
Merged
Merged
Conversation
…ository The CI workflows are shared with Kpa-clawbot/CoreScope, where a push to master publishes to GHCR, dispatch on a tag uploads release assets, the staging job deploys via a self-hosted runner and the badge job commits files to master. On a fork the same runs would attempt all of that, and the only thing stopping it today is a failing test step. Add `github.repository == 'Kpa-clawbot/CoreScope'`, ANDed with each existing condition, to: - deploy.yml: the five GHCR publish steps in build-and-publish (the local staging image build stays unguarded), and the release-artifacts, deploy and publish jobs (job level, so the self-hosted deploy job is never scheduled on a fork); - release-fast-path.yml: the retag-or-fallback job (GHCR re-tag and the deploy.yml dispatch). Tests, e2e and CI artifact uploads keep running on forks; upstream behaviour is unchanged. A config-gate test pins the guards, the kept conditions and the unguarded test jobs. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
adminopenclaw8-sketch
pushed a commit
that referenced
this pull request
Sep 14, 2026
…rl comments Two review fixes on this PR. 1. CI registration. `test-issue-1890-og-url.js` was only wired into `test-all.sh` (used by `npm test`), not into the JS test step in `.github/workflows/deploy.yml`. CI could not catch a regression of the hardcoded og:url. Added `node test-issue-1890-og-url.js` to that step's existing list, directly before `test-issue-1375-scope-stats- fetch.js` (the test that currently stops the step). test-all.sh is unchanged; the registration there was already correct. 2. Comment accuracy, in `public/index.html` and `test-issue-1890-og-url.js`. The removed tag declared the upstream analyzer instance's own URL as the canonical URL for every self-hosted deployment (Kpa-clawbot#1890) -- correct metadata for upstream, wrong for everyone else. Reworded both comments to say that precisely, and to stop implying things not established: - og:url is metadata, not an HTTP redirect, and does not by itself decide what a viewer's click navigates to. - Per the Open Graph protocol it is a required property, not "optional" -- omitting it leaves the crawled URL as the fallback canonical reference, which is what actually fixes this for every instance. - This change does not refresh previews a consumer has already cached under the old, hardcoded value. No functional assertions changed in test-issue-1890-og-url.js -- only the file-level comment. The `public/index.html` comment change had to avoid writing the literal removed domain: the test's own 4th assertion scans the whole file for that string, and an earlier draft of this comment briefly reintroduced it and failed its own guard before landing on the current wording. Verified on this branch's own base (pre-#51/#33 master) and against a merge into current master: test-issue-1890-og-url.js passes 4/4 on the resulting index.html and still fails 2/4 (og:url present, 00id.net present) against the original hardcoded tag. The merge result's deploy.yml differs from current master by exactly the one added test line; release-fast-path.yml and cmd/server/fork_guard_workflow_test.go are byte-identical to master, and all four #51 repository guards (the five build-and-publish publish steps, release-artifacts, deploy, publish, retag-or-fallback) are present in the merged file. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
dborup/CoreScoperuns the same workflows as upstreamKpa-clawbot/CoreScope. As they stand onmaster(fda24ca5), a run on this fork would try to do everything upstream does:dborup/CoreScopemaster, e.g. merging any PRbuild-push-action(push: true, GHA cache write), Deploy Staging on[self-hosted, meshcore-runner-2](docker compose … up -d), badge commits tomastervia the Contents API withBADGE_PUSH_TOKENworkflow_dispatchonmasterworkflow_dispatchon av*tag, including the fast-path fallback dispatchrelease-artifacts:softprops/action-gh-releasewithcontents: writev*tagrelease-fast-path: GHCR login,crane tag,gh workflow run deploy.ymlThe only thing that stops this chain today is a failing test step in "Go Build & Test". That is not protection.
Change
github.repository == 'Kpa-clawbot/CoreScope'is ANDed with the existing condition of every job or step that has an external side effect. No existing condition is replaced..github/workflows/deploy.ymlbuild-and-publish, step level: the five publish steps are Set up Docker Buildx, Set up QEMU, Log in to GHCR, Extract Docker metadata and Build and push to GHCR. Each is nowif: github.event_name == 'push' && github.repository == 'Kpa-clawbot/CoreScope'.needschain unchanged.release-artifacts, job level:startsWith(github.ref, 'refs/tags/v') && github.repository == 'Kpa-clawbot/CoreScope'.deploy, job level: the existing push/dispatch +refs/heads/mastercondition gets&& github.repository == 'Kpa-clawbot/CoreScope'. Because the guard is at job level, the self-hosted deploy job is never even scheduled on the fork.publish, job level:github.event_name == 'push' && github.repository == 'Kpa-clawbot/CoreScope'..github/workflows/release-fast-path.ymlretag-or-fallback, job level:if: github.repository == 'Kpa-clawbot/CoreScope'. This covers the GHCR re-tag and thegh workflow run deploy.ymlfallback dispatch.cmd/server/fork_guard_workflow_test.go(new; test only, same text-based "config gate" pattern asrelease_fast_path_workflow_test.go). It pins:build-and-publishstaying unconditional at job level;go-testande2e-testhaving no job condition and no repository guard.Not changed: triggers,
permissions, secrets, runners, environments, concurrency, test steps, CI artifact uploads (upload-artifactof the badge JSON), the squad workflows, production code, Dockerfiles and Go versions.Event / repository matrix
Job
if:expressions were evaluated from the parsed YAML for each case, followingneeds. Every non-skipped predecessor is assumed to succeed, so the result does not depend on tests failing. GitHub's case-insensitive string comparison is used.GHCR= the five publish steps insidebuild-and-publish.run/skiprefer to jobs.dborup/CoreScopefda24ca5)pull_request→ mastermasterworkflow_dispatchmasterworkflow_dispatchv*tagv*tagKpa-clawbot/CoreScopeThe evaluated output is identical before and after for all five events:
pull_request: tests and build, no GHCR, no deploy.master: tests, build + GHCR, deploy and publish.master: deploy.v*tag: release-artifacts.v*tag: retag-or-fallback.The fork's
go-test,e2e-testandbuild-and-publishstatuses are unchanged for every event; no test job becomes skipped because a publish job is skipped.Other workflows
These do not deploy, publish images or releases, or push files, so they are unchanged here. Their remaining external writes are listed for a separate decision:
squad-heartbeat(schedule every 30 min, issues closed/labeled, PR closed, dispatch): adds labels and comments to issues, and assigns Copilot when.squad/team.mdopts in.squad-triageandsquad-issue-assign(issues labeled): add labels, comments and assignees.sync-squad-labels(push touching.squad/team.mdor.ai-team/team.md, dispatch): creates and updates labels.No reusable workflows (
workflow_call), composite actions orpull_request_targetexist, and none of the scripts invoked by the workflows push, publish or deploy.Verification
actionlint/yamllintare not available locally, so GitHub-specific expression linting was not run beyond evaluating the job and step conditions above.cd cmd/server && go test -run 'TestForkGuard|TestReleaseFastPathWorkflowExists|TestDeployWorkflowNoLongerTriggersOnTags'passes all 5 tests.go-test, dropping the fast-path guard, or replacing (instead of ANDing) the publish condition each make the new test fail with a specific message;go vet ./...(cmd/server) passes,gofmt -lis clean andgit diff --checkis clean.permissions,runs-on,secrets.,environment:or trigger lines touched.CI on this PR
Opening this PR triggers only
CI/CD Pipelineonpull_request(notypes:filter, soopened/synchronize/reopened). For a same-repository PR that run uses the workflow as it exists on this PR's merge ref, i.e. with the guards. None of the side-effect jobs or steps can run for apull_requestevent either before or after this change.Expected result: "Go Build & Test" still fails on the documented baseline
TestPruneOldNeighborMetrics, because PR 33 is not merged yet. Downstream jobs are skipped. This PR does not claim green CI.Limitations
v*tag pushed to a commit that predates this change runs the old, unguardedrelease-fast-path.yml;workflow_dispatchagainst an old ref uses that ref's unguardeddeploy.yml;Safe rollout (for the later merge decision)
master, and that push run uses the workflow file from the merge commit itself, so the guards already apply to that first run. On this fork it runs tests and the local image build only, with no GHCR, deploy or badges.CI/CD Pipelinerun is queued or in progress from an older revision (gh run list --status queued/in_progress). At the time this PR was opened there were none, and no push-event run has ever happened on this fork.🤖 Generated with Claude Code