Open grst opened 7 months ago
I recently made a GitHub application: https://github.com/apps/spencer-hobson
It was relatively easy. Manually, we use it like this:
- name: Get bot token
id: create_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.SPENCER_APP_ID }}
private_key: ${{ secrets.SPENCER_PRIVATE_KEY }}
- name: Clone repo
uses: actions/checkout@v4
with:
token: ${{ steps.create_token.outputs.token }}
fetch-depth: 0
filter: blob:none
- name: Commit autofixes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: auto-fix eslint errors"
commit_user_name: spencer-hobson[bot]
# This uses the anonymous identity record number you can get via:
# https://api.github.com/users/spencer-hobson[bot]
commit_user_email: 149329160+spencer-hobson[bot]@users.noreply.github.com
but of course that only works in repos that have access to the private key, so we need to figure out how to make the app do its thing with a central installation.
When someone creates a PR from a fork, the CI does not have permission to add commits to the branch.
To my knowledge, the only real way to solve this is to develop a github application.
For now, it is easiest to add someone who makes a PR to this repo and ask them to push to a local branch.
CC @flying-sheep