Skip to content

fix(ci): harden GitHub Actions workflows (#250) - #252

Merged
mattt merged 1 commit into
mainfrom
security/workflow-hardening/pr-250
Sep 16, 2026
Merged

mattt merged 1 commit into
mainfrom
security/workflow-hardening/pr-250

Conversation

@hf-security-analysis

@hf-security-analysis hf-security-analysis Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Automated hardening of the workflow files flagged on #250.

Warning

This changes when the workflow runs and what it can reach. Both triggers and permissions were rewritten in .github/workflows/ci.yml. Read the diff before merging — either one can change what the workflow is able to do.

Targets main. Files changed:

  • .github/workflows/ci.yml

Fixed by this PR:

  • HIGH excessive-permissions (zizmor) — .github/workflows/ci.yml:11

Permissions

.github/workflows/ci.yml

job granted why
test-macos contents: read Only checks out the repo (actions/checkout), restores an actions/cache entry, and runs swift format/build/test locally, so contents: read for checkout is all that is needed; caching within the same repo requires no token scope.
build-watchos contents: read Checks out the repo and runs xcodebuild locally; no API calls, so contents: read for actions/checkout suffices.
test-linux contents: read Checkout plus actions/cache and swift build/test inside a container; no step writes to the repository or PR, so only contents: read is required (the workflow-level pull-requests: write is unused).

Anything not listed above keeps the permissions it had. To measure a job this could not read, add GitHubSecurityLab/actions-permissions/monitor to it and run the workflow — it reports the minimum the run actually used.

Pinning changes come from pinact and are mechanical. Any other change was generated by Claude — read it before merging.

Closes huggingface/tracking-issues#949

@mattt
mattt merged commit 62937f1 into main Sep 16, 2026
12 checks passed
@mattt
mattt deleted the security/workflow-hardening/pr-250 branch September 16, 2026 19:05
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