Skip to content

Conversation

@ashwinb
Copy link
Contributor

@ashwinb ashwinb commented Nov 14, 2025

  • pre-commit is not given the GITHUB_TOKEN so a malicious pre-commit from a fork cannot end up with write access to the repo
  • restrict the apply-pre-commit workflow to hooks that actually modify files so detection-only checks are skipped
  • clarify that the trusted subset now focuses on automatic fixes for commit-ready changes

@ashwinb ashwinb changed the title Limit autofix workflow to auto-fixing hooks feat(ci): re-introduce pre-commit fixer workflow but limit autofixes for now Nov 14, 2025
run-name: Apply a subset of pre-commit fixes

on:
workflow_dispatch:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security guardrail #1: manual workflow dispatch

fetch-depth: 0
persist-credentials: false

- name: Retrieve trusted pre-commit config
Copy link
Contributor Author

@ashwinb ashwinb Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security guardrail #2 (but also limitation): don't trust the pre commit config from the PR

env:
GITHUB_TOKEN: ''

- name: Run trusted pre-commit subset
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guardrail #3: only run a small subset of pre-commit hooks. Things like "npm ci" have vulnerabilities. We should likely include more of our custom things here but I think like above, should use "main" as the source of truth of the hook.

@mergify
Copy link

mergify bot commented Nov 15, 2025

This pull request has merge conflicts that must be resolved before it can be merged. @ashwinb please rebase it. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Nov 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. codex needs-rebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants