Skip to content

Commit

Permalink
Use GitHub App credentials for commits
Browse files Browse the repository at this point in the history
These can be obtained using the following command:

export APP_ID=123456
export APP_SECRET="$(cat app.private-key.pem)"
export GH_REPO=owner/repo
export TOKEN=$(bash get_github_app_token.sh)
curl -X PUT \
    -H "Authorization: token ${TOKEN}" \
    -H "Accept: application/vnd.github.v3+json" \
    https://api.github.com/repos/$GH_REPO/contents/test-file \
    -d '{"message":"message","content":"Y29udGVudA==","branch":"test"}'

This will create a commit on branch `test`. The branch must exist.
The command will return a JSON that has wanted credentials.
This needs open-ssl, jq and curl, and the following script:

https://gist.github.com/987Nabil/594764a7444cb5eee0636607d06f43c5
  • Loading branch information
oakkitten committed May 22, 2022
1 parent 00935f1 commit 516ba11
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ jobs:

- name: Prepare git
run: |
git config user.name kittenoak
git config user.email kittenoak@users.noreply.github.com
git config user.name "anki-wallpaper[bot]"
git config user.email "105947902+anki-wallpaper[bot]@users.noreply.github.com"
- name: Update pre-release test environment
if: matrix.environment == 'pre-release'
Expand Down

0 comments on commit 516ba11

Please sign in to comment.