.gitar/rules/restrict-workflow-changes.md
GitHub Actions workflow files control CI/CD execution and can be a vector for supply-chain attacks (e.g. exfiltrating secrets, running malicious code on runners). Only repository maintainers should modify them.
When evaluating a pull request:
.github/workflows/ is modified.github/CODEOWNERS)Inspect the PR diff for any files matching:
.github/workflows/** (any file inside the workflows directory)If no workflow files are modified, skip this rule.
Read .github/CODEOWNERS and extract the maintainer usernames from the global * ownership line.
If the PR author username is in that list, the change is allowed — skip and approve.
When a non-maintainer PR modifies .github/workflows/, post a comment asking the contributor to:
Include the list of workflow files that were modified.
The rule is automatically skipped when ANY of these is true:
.github/CODEOWNERS.github/workflows/⚠️ Workflow changes require maintainer authorship
This PR modifies the following GitHub Actions workflow file(s):
.github/workflows/ci-checks.ymlChanges to
.github/workflows/can only be made by repository maintainers, since they control CI execution and have access to repo secrets.Please:
- Revert the workflow changes from this PR so the rest can be reviewed.
- Open a new issue describing the workflow change you'd like, and a maintainer will pick it up in a separate PR.
This rule is complementary to other Gitar rules:
All rules run independently; this one only fires when workflow files are touched.