Skip to content

Run prek as a GitHub Action#67

Closed
DimitriPapadopoulos wants to merge 3 commits intopoldracklab:masterfrom
DimitriPapadopoulos:prek
Closed

Run prek as a GitHub Action#67
DimitriPapadopoulos wants to merge 3 commits intopoldracklab:masterfrom
DimitriPapadopoulos:prek

Conversation

@DimitriPapadopoulos
Copy link
Copy Markdown
Contributor

@DimitriPapadopoulos DimitriPapadopoulos commented Mar 4, 2026

This requires to enable GitHub Actions in this repository.

@effigies
Copy link
Copy Markdown
Contributor

effigies commented Mar 4, 2026

Can you provide a summary of what this is supposed to do?

@DimitriPapadopoulos
Copy link
Copy Markdown
Contributor Author

DimitriPapadopoulos commented Mar 4, 2026

prek is a drop-in replacement of pre-commit written in Rust.

Like pre-commit, prek can be run:

  • by developers on their computer, typically with prek run -a or as a Git commit hook,
  • during CI: an equivalent of the pre-commit.ci service is not available (yet?) but a well-maintained GitHub Action is provided, which I use here.

Because it's a drop-in replacement, developers can keep using pre-commit locally if they prefer so, while other developers and CI can switch to prek.

@DimitriPapadopoulos
Copy link
Copy Markdown
Contributor Author

@effigies
Copy link
Copy Markdown
Contributor

effigies commented Mar 4, 2026

I would suggest just using https://pre-commit.ci/, rather than adding a new GHA workflow.

@DimitriPapadopoulos
Copy link
Copy Markdown
Contributor Author

DimitriPapadopoulos commented Mar 4, 2026

The thing with pre-commit.ci, which by the way is not enabled in this repository as far as I can see, is that you give it full repository access. That's an additional operator you need to trust.

@DimitriPapadopoulos
Copy link
Copy Markdown
Contributor Author

GitHub Actions, on the other hand, need not this additional service provider. They are run by GitHub, and you already trust GitHub services by hosting the repository on their servers.

@DimitriPapadopoulos
Copy link
Copy Markdown
Contributor Author

The idea here was to use prek instead of pre-commit. For now prek can only be run from GHA.

Because `prek` is a `pre-commit` drop-in replacement,
it can use `.pre-commit-config.yaml` as a config file.
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.

2 participants