-
-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Idea: A bot to run pre-commit and commit formatted code #211
Comments
Seems like a fine idea -- though I don't have the slightest idea on where to host such a thing however I'm going to move this to the docs repo since it's less about the framework and more about ancillary tools. I'd be happy to help set something like this up if there's interest and direction 👍 I believe @nicoddemus @RonnyPfannschmidt @obestwalter have expressed interest in a similar thing in the past as well, CCing them in case they have input |
The Probot docs have deployment instructions for Glitch, Heroku, Now, GH Actions, AWS Lambda, and Google Cloud Functions: https://probot.github.io/docs/deployment . |
I wonder if this makes more sense as a GitHub Action. There's already actions implemented for a number of linters and formatters: https://github.com/bltavares/actions |
I really really really want to set up a github action but I haven't been allowlisted into the beta yet :'( |
The Restyled project (https://restyled.io/) uses GitHub actions to run formatters against PRs. I've suggested adding pre-commit support: restyled-io/restylers#29 |
This Github action would would save so much time. I found this existing action that look like a very close match. Maybe just adding jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- name: Create local changes
run: |
pre-commit run --all-files
- name: Commit files
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -m "Add changes" -a
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }} |
@Pierre-Sassoulas have you seen https://pre-commit.ci/? It is developed by the primary pre-commit maintainer and sounds like exactly what you want. |
yeah this isn't possible to do safely with github actions -- so I made pre-commit.ci which is now the official way to run pre-commit in CI for github |
It would be great to have a GitHub bot that could execute
pre-commit run ...
on a PR then add a commit to the PR with the formatting changes, if there are any.This would act as a last resort, ensuring that both maintainers and contributors don't need to care about formatting code.
Does this exist? If not, is there any interest in collaborating on something like this?
Prior discussions
black
and adds a commit. I suggested supporting pre-commit: [idea] Integrate with pre-commit Mariatta/black_out#47The text was updated successfully, but these errors were encountered: