Skip to content

chore: drop unused upstream workflows; pin .github/workflows during sync - #4

Merged
sc0rp10 merged 2 commits into
mainfrom
chore/drop-unused-workflows-and-pin
Sep 14, 2026
Merged

sc0rp10 merged 2 commits into
mainfrom
chore/drop-unused-workflows-and-pin

Conversation

@sc0rp10

@sc0rp10 sc0rp10 commented Sep 14, 2026

Copy link
Copy Markdown

Fixes the Fork sync push rejection permanently and finishes the workflow cleanup.

Why the push kept failing

There is no GITHUB_TOKEN permission scope that allows pushing workflow-file changes — workflows: is not a valid key, and actions: write is unrelated. The token is simply never allowed to update .github/workflows/*, so any sync branch carrying workflow deltas will be rejected:

! [remote rejected] (refusing to allow a GitHub App to create or update
  workflow ... without workflows permission)

The fix: the fork owns .github/workflows

fork-sync.sh now merges with --no-commit, then before concluding the merge:

  • mirrors .github/workflows from origin/main over the merge result — upstream workflow changes and re-additions are dropped, our dropped files stay dropped
  • writes the fork version into releaseVersion/src/runnerversion (the two files that conflict by construction on every sync)
  • only other conflicts still go to a human + tracking issue

The pushed branch therefore carries zero workflow deltas → the standard token can push it → no PAT, no secrets, nothing to maintain.

Workflow cleanup

Dropped (on top of the unstaged deletions staged here):

  • dependency-check.yml — manual dep audit, same category as the upgrade automation
  • docker-buildx-upgrade.yml — weekly dep-PR generator, same family as dotnet/node-upgrade
  • .github/dependabot.yml — daily dep PRs for docker/actions/nuget/npm

Kept: build.yml (Runner CI), release.yml (Runner CD), docker-publish.yml (fork-patched GHCR publisher — manual entrypoint, say the word if it moved elsewhere and it goes too), fork-sync, fork-patches.

Verified in a sandbox with a hostile fixture

Upstream "release" that modifies kept workflows, modifies deleted ones (modify/delete conflicts), and adds a brand-new workflow: merge concluded unattended, git diff origin/main..sync-branch -- .github/workflows is empty, workflow dir is exactly the fork's 5 files, version 2.10337.0, patch gate green, real upstream changes (docs/images/src) still flow through.

After merge

Trigger Fork sync manually (gh workflow run 'Fork sync' -R AdguardTeam/runner) — it should finally open the chore: sync with upstream 2.337.0 PR.

The fork follows upstream releases wholesale: dependency upgrades,
code scanning and issue gardening happen upstream, no need to burn
this repository's Actions minutes on them.

Dropped:
- close-bugs-bot / close-features-bot / stale-bot (upstream issue
  triage bots - never ran here)
- codeql (done upstream)
- dotnet-upgrade / node-upgrade / docker-buildx-upgrade / npm-audit /
  npm-audit-typescript (dependency automation we do not want)
- dependency-check (manual dep audit, same category)
- .github/dependabot.yml (daily dep PRs, same category)

Kept: build (Runner CI), release (Runner CD), docker-publish
(fork-patched GHCR publisher, manual).
The GITHUB_TOKEN cannot create or update workflow files, so a push
carrying workflow deltas is always rejected:

  ! [remote rejected] (refusing to allow a GitHub App to create or
    update workflow ... without `workflows` permission)

and no GITHUB_TOKEN permission scope exists that changes that.

Fix the sync flow instead: merge with --no-commit, then mirror
.github/workflows from origin/main over the merge result and write the
fork version into the version files before concluding the merge. The
pushed branch therefore never carries workflow-file deltas, upstream
cannot resurrect the workflows we dropped, and the version-file
conflicts that happen on every sync are resolved as a side effect.

Also clean up the fork-sync.yml permissions block (the actions: write
hand-fix was unnecessary) and renumber the script step comments.
@sc0rp10
sc0rp10 merged commit e530a58 into main Sep 14, 2026
9 of 20 checks passed
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