Repository navigation
feat(ci): validate workflow actions against repository policy #3624
Description
User Story
As an OpenShell maintainer, I want pull-request CI to detect workflow action references that violate the repository GitHub Actions policy, so that release and maintenance workflows do not fail at startup after merge.
Problem Statement
Workflow linting currently checks syntax and security findings but does not validate external uses: references against the effective Actions permissions for the repository. A workflow can therefore pass pull-request checks and merge while referencing an action revision that GitHub rejects before any job starts.
Impact / Why This Matters
Maintainers discover these conflicts only when the affected workflow is triggered, which may happen during a release. The current workaround is to run the workflow after merge or manually compare every action SHA with a large policy allowlist. That is late, error-prone, and can block time-sensitive release work.
Proposed Design
When a pull request changes a GitHub Actions workflow or action definition, a required CI check should validate its external action and reusable-workflow references against the effective policy that GitHub will enforce for OpenShell. The check should report each rejected reference and enough policy context to choose an approved revision or request approval. Changes that do not affect workflow references should avoid unnecessary work.
Acceptance Criteria
- Pull requests that add or change external action or reusable-workflow references receive a policy compatibility check.
- The check evaluates the effective repository policy rather than relying on a separately maintained copy of the allowlist.
- A disallowed owner, repository, tag, or SHA fails before merge with an actionable annotation identifying the reference.
- Enterprise-owned, GitHub-owned, verified Marketplace, explicitly allowed, local, and reusable-workflow references are handled consistently with GitHub enforcement.
- Policy lookup or evaluation failures produce a clear diagnostic and cannot silently report success.
- Existing workflow syntax and security checks continue to run.
Alternatives Considered
Relying on manual review or post-merge workflow dispatch keeps the failure late and depends on maintainers noticing exact SHA-level allowlist mismatches. Maintaining a second allowlist in the repository risks drift from the GitHub policy and would not reliably predict enforcement.
Agent Investigation
Release Tag run 35874219573 failed with startup_failure before creating jobs because oras-project/setup-oras@38de303aac69abb66f3e6255b7198bff35f323e3 was not allowed. The effective repository policy allowed the same action only at 1d808f7d7f6995cc68b7bf507bfe5c5446e1dc9d.
Activity
purp commentedon Sep 23, 2026
purp commentedon Sep 23, 2026
Implemented in #3634.
The PR adds a secretless
pull_request/merge_grouprequest workflow and a trusted default-branchworkflow_runconsumer. The checker structurally finds executableuses:references, compares only added occurrences for PRs, scans the complete queued tree for merge groups, reads the live repository and enterprise policy inputs, and publishes the requiredOpenShell / Workflow Policystatus with file/line diagnostics. It fails closed on incomplete or ambiguous inputs.Verification completed:
mise run test:github-actions-policy— 36 passedmise run pre-commit— passedmise run ci— passedupstream/main— 362 references evaluated, 0 rejectedPost-merge rollout still requires configuring
ACTIONS_POLICY_READ_TOKEN,ACTIONS_ENTERPRISE_READ_TOKEN, addingOpenShell / Workflow Policyto the required ruleset, and running a disposable allowed/disallowed canary PR.github-actions commentedon Oct 8, 2026
This issue has had no activity for 14 days and is now marked stale. It may be closed in 7 days if there is no further activity. Comment or remove the state:stale label to keep it open.