Skip to content

Upstream workflows run on the fork between fork-sync runs #14

Closed

Description

@ibetitsmike

Xum opened this issue on behalf of @ibetitsmike.

What happened

Upstream coder/coder workflows run on the fork although only fork-* workflows are meant to be enabled:

When (UTC) Workflow Ref Event Result
2026-11-08 00:17 Stale Issue, Branch and Old Workflows Cleanup main schedule success (run 42429053408; actions/stale with days-before-pr-stale: 7, delete-old-branches-action; no deletions seen in the log)
2026-11-08 20:00, 20:14 docs-preview, weekly-docs mike/chat-plugins pull_request success
2026-11-08 21:38 docs-preview, weekly-docs mike/computer-use-openai-compat pull_request success / no conclusion
2026-11-08 21:49 Update coder.com/docs main push of 03753eba28 (#3) failure, run 42527121461: ALGOLIA_DOCS_SYNC_SECRET is not configured
2026-11-08 21:54 AI Triage via Chat API (10 runs) main issues (W0a to W7 issues opened) skipped

Earlier, on 2026-11-07, Linear Release and OpenSSF Scorecard ran on the push of #1 and Backport/Cherry-pick to release on its PR, right after the first disable pass.

Cause

GitHub registers a workflow file lazily, on the first event that matches its triggers, and a newly registered workflow starts in the active state. The fork has the upstream workflow files, so each upstream workflow is registered (active) the first time a push, PR, issue or schedule matches it. fork-sync.yaml's quiet-upstream-workflows job disables every active non-fork-* workflow, but it only runs with fork-sync (05:00 UTC daily or on demand), so a workflow registered between two syncs runs freely until the next sync. Evidence from GET /repos/ibetitsmike/coder/actions/workflows: the four workflows active now were all created today after the 05:07 fork-sync run (docs-preview and weekly-docs 20:00 UTC, Update coder.com/docs 21:49 UTC, AI Triage via Chat API 21:54 UTC); the 11 disabled ones were disabled by fork-sync runs on 2026-11-07 and 2026-11-08 05:07 UTC.

Note: fork-sync currently fails at its sync job for a missing secret (separate issue), but its quiet-upstream-workflows job uses github.token and still runs.

Impact

  • Upstream jobs can act on the fork with its GITHUB_TOKEN: the stale job labels PRs older than 7 days, the branch cleanup deletes old branches, docs workflows post previews. Fork PRs live longer than 7 days during the pstack work.
  • Failed runs on main (deploy-docs) add noise next to fork-ci. Autodeploy gates on fork-ci only, so deploys are not blocked.
  • Actions minutes on upstream jobs.

Reproduce

  1. gh api repos/ibetitsmike/coder/actions/workflows --paginate --jq '.workflows[]|select(.state=="active")|[.name,.path,.created_at]|@tsv' lists non-fork-* workflows as active.
  2. gh run list -R ibetitsmike/coder -L 60 shows their runs.

Possible fixes (for triage)

  • Run the disable step more often and close to the trigger: a fork-quiet workflow on schedule (hourly) plus push, pull_request and issues events, so a new registration lives minutes, not a day. It cannot stop the first run of a new registration.
  • Stop the first run too: keep upstream workflow files out of the fork's default branch, or have fork-sync add a fork-only guard. Both change what a sync merges, so weigh them against sync conflicts.
  • Repo setting: Actions "Allow select actions" does not block workflows that only use run: steps, so it is not enough alone.

Suspected change: none; the behavior exists since the fork was created. It shows now because issues were enabled and docs changed on main today.

Activity

  1. added
    followup
    needs-triage
    on Nov 8, 2026
  2. ibetitsmike commented on Nov 8, 2026

    @ibetitsmike
    OwnerAuthor

    Xum commented on behalf of @ibetitsmike.

    Mitigation, 2026-11-08 22:05 UTC: disabled the five upstream workflows that were active (Update coder.com/docs, docs-preview, weekly-docs, AI Triage via Chat API, and eval/coder-agents, which registered at 21:59 UTC on an issue_comment event and was skipped). Only fork-ci and fork-sync are active now. This does not fix the cause: the next upstream workflow that matches an event registers active again.

    Triage: real and present on current main (03753eba28). Priority P2: no deploy impact (autodeploy gates on fork-ci only), but the stale and branch-cleanup jobs can act on long-lived fork PRs and branches. Accepted.

  3. removed
    needs-triage
    on Nov 8, 2026
  4. ibetitsmike commented on Nov 8, 2026

    @ibetitsmike
    OwnerAuthor

    Xum commented on behalf of @ibetitsmike.

    Opened #18: a fork-quiet workflow disables and cancels upstream workflows hourly and on push, PR, issue, comment, create and release events.

  5. ibetitsmike commented on Nov 8, 2026

    @ibetitsmike
    OwnerAuthor

    Xum commented on behalf of @ibetitsmike.

    #18 is ready at 85f532d445: fork-ci is green, the interim Opus review passed (Codex has not answered), and the PR's own fork-quiet runs ended the stuck upstream run 42526199687.

  6. ibetitsmike commented on Nov 8, 2026

    @ibetitsmike
    OwnerAuthor

    Xum commented on behalf of @ibetitsmike.

    #18 merged as b3a57df790. fork-quiet has now run green on main for push, issues and issue_comment events. Only fork-ci and fork-quiet are active.

  7. ibetitsmike commented on Nov 8, 2026

    @ibetitsmike
    OwnerAuthor

    Xum commented on behalf of @ibetitsmike.

    Opened #19: the README now says when fork-quiet runs for the local sync.

  8. ibetitsmike commented on Nov 8, 2026

    @ibetitsmike
    OwnerAuthor

    Xum commented on behalf of @ibetitsmike.

    #19 merged as c97ebc1794. The work for this issue is complete.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    followup

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions