fix(ci): unblock docs-sync and release-please from CodeQL gate#101
Merged
Conversation
- Replace direct push to main with PR-based approach - git-auto-commit-action pushed directly to main, which was blocked by the CodeQL branch protection rule (circular dependency: CodeQL runs after push, but push requires CodeQL results) - New approach: create a short-lived branch, commit, open PR with auto-merge enabled, and let CodeQL pass on the PR before merging - No infinite loop risk: trigger paths (plugins/**, marketplace.json) don't include README.md or docs/ — so the merged commit won't re-trigger docs-sync - Adds pull-requests: write permission required for gh pr create Also: ruleset updated via API to remove ~ALL from conditions, keeping only ~DEFAULT_BRANCH — this unblocks release-please from updating refs/heads/release-please--branches--main. Generated by Nuno Salvação <nuno.salvacao@gmail.com> & Co-Authored with: Nexo <nexo.modeling@gmail.com>
Contributor
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Docs Sync CI workflow to avoid direct pushes to main (which were blocked by CodeQL branch protection), by switching to a PR-based docs update flow.
Changes:
- Added
pull-requests: writepermission for the docs-sync job. - Replaced direct auto-commit to
mainwith: detect changes → create branch → push → open PR → enable auto-merge.
- Include run_attempt in branch name (run_id-run_attempt) so each attempt gets a unique ref — prevents non-fast-forward push failure on reruns of the same workflow run (R1) - Switch git checkout -b to -B (force) to handle any residual branch from a failed prior step cleanly (R2) - Capture PR number after creation and use it for gh pr merge instead of branch-name resolution; add idempotent lookup so partial failures (push OK, pr create failed) re-use the existing PR on retry (R2) Generated by Nuno Salvação <nuno.salvacao@gmail.com> & Co-Authored with: Nexo <nexo.modeling@gmail.com>
Owner
Author
|
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.
Summary
Two CI workflows were failing after every merge to
maindue to a branch protection ruleset that applied to ALL branches (~ALL) and required CodeQL results before any push — creating circular dependencies.Root causes
Docs Sync —
git-auto-commit-actionpushed directly tomain. The CodeQL branch protection rule blocks the push until CodeQL has run on that commit, but CodeQL can only run after the push. Circular dependency, not solvable without changing the architecture.Release —
release-please-actionupdatesrefs/heads/release-please--branches--main(its internal tracking branch). The ruleset's~ALLcondition applied CodeQL gate to ALL branches, including this release-please branch — making it impossible for release-please to function.Fixes applied
Ruleset change (applied directly via GitHub API):
~ALLfrom ruleset conditions — keeps only~DEFAULT_BRANCHmain, not to every branch in the reporefs/heads/release-please--branches--maindocs-sync.ymlworkflow change (this PR):git-auto-commit-actiondirect push with a PR-based approachchore/docs-sync-<run_id>, commits, opens a PR, and enables auto-mergeplugins/**,.claude-plugin/marketplace.json,scripts/sync-docs.py) don't includeREADME.mdordocs/— merged commit won't re-trigger docs-syncTest plan
workflow_dispatchon Docs Sync and verify it creates a PR with auto-mergeplugins/**and verify the full cycle completes🤖 Generated with Claude Code