Repository navigation
feat: pin required checks to an app, manage org Actions workflow settings - #45
Conversation
…ings
A required check may be written as {context: <name>, app_id: <id>}; plain
names keep working and mean no pin. sync sends the pin as integration_id,
diff and the no-op check compare it, and sync-from-org writes it back.
A top-level actions block holds the org's default_workflow_permissions and
can_approve_pull_request_reviews (PUT /orgs/{org}/actions/permissions/workflow).
Without the block they are left alone and not compared.
|
Warning Review limit reached
This review includes 3 billable files and costs up to $0.75.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 34 minutes for your next included review. View limit details
No actionable comments were generated in the recent review. WalkthroughThis PR adds app-pinned required checks and optional organization Actions settings to the configuration model, GitHub sync and diff logic, exported YAML, tests, and documentation. ChangesPinned checks and organization Actions settings
Estimated code review effort: 4 (Complex) | ~50 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant Config
participant Sync
participant GitHub Org Actions API
participant GitHub Ruleset API
Sync->>GitHub Org Actions API: Read managed Actions settings
Sync->>GitHub Ruleset API: Read required checks and integration_id
Sync->>GitHub Org Actions API: PUT configured Actions settings when different
Sync->>GitHub Ruleset API: Update required checks with context and app_id
Possibly related PRs
Suggested reviewers: Merge Risk:
|
…tings A plain check name keeps the pin its ruleset has: only an app_id sets or changes one, so sync never removes a pin. Rewriting Require CI keeps the ruleset's branch conditions and strict policy instead of resetting them to the default branch and not strict; a ruleset gh-config can't keep that for is refused. sync-from-org logs Actions settings it couldn't read at the default level and names them in its last line instead of reporting success. README: the Actions block needs org Administration read/write.
625109e to
c3cdf75
Compare
Two additions gitkb/org needs before gitkb-core switches CI (panel decision 2026-11-19, Q2 and Q4).
Required checks pinned to an app
Before,
required_checkswas a list of names. gh-config kept a pin the ruleset already had but couldn't set one, and the drift check ignored pins.syncsends the pin asintegration_id. The no-op check anddiffcompare it, so a missing or wrong pin counts as drift.sync-from-orgwrites it back, so drift PRs keep it.app_idin the config sets or changes a pin. A plain name keeps the pin the ruleset already has, as before, sosyncnever removes one.diffshows a live pin the file doesn't name, andsync-from-orgrecords it.Require CInow keeps the ruleset's branch conditions andstrict_required_status_checks_policy. Before, it reset them to~DEFAULT_BRANCHand not strict, so a pin update could have narrowed or weakened a ruleset. A ruleset that targets anything but branches, or has no conditions, is refused. A live read on 2026-11-19 found all 67 gitkbRequire CIrulesets active, on~DEFAULT_BRANCHonly, not strict, enforced on create, and none pinned, so none would have been weakened.Org Actions workflow settings
PUT /orgs/{org}/actions/permissions/workflow, and only when they differ from GitHub.--dry-runprints the change. It runs after the bypass-list checks and before teams and repos.syncleaves these settings alone anddiffdoesn't compare them.sync-from-orgalways records them when it can read them. A failed read is logged at the default level, and the last line names what wasn't recorded instead of saying "completed successfully". If the file has the block, its values are kept anddiffexits 1.admin:org). The gitkb Org Config App doesn't have that today.Tests
appid, a missingapp_idand a duplicate are refused; theactionsblock's keys and values.syncrewrites only those two with the pin, the export writes each pin back and itsdiffis clean; Actions settings are written once, a dry run and a matching config write nothing, they round-trip, and a config without the block shows no diff. A plain name over a live pin writes nothing; a rewrite keeps the live pin, the branches and strictness; an Actions read that fails (403) is named and not drift without the block, and kept and drift with it.Not verified here: nothing was built or run locally, so CI is the only test. Not checked against live GitHub: the PUT itself, and whether gitkb/org's token can read and write the org workflow settings (that needs org administration access).