Run the bump workflow as the Cottage catalog bot GitHub App (#33)
Pull requests opened with the default workflow token don't start CI, and the repository doesn't let Actions create pull requests. The run now mints a token for the GitHub App installed on this repository (BUMP_APP_ID variable, BUMP_APP_KEY secret).
This commit is contained in:
1 parent
1bef43c3d6
commit
3fa3e76a3b
1 file changed
+12
-7
@@ -1,8 +1,8 @@
|
||||
name: Bump recipes
|
||||
# Opens one pull request per recipe whose upstream has a newer stable release (scripts/bump.py).
|
||||
# Pull requests opened with the default GITHUB_TOKEN don't start other workflows, so set the
|
||||
# BUMP_TOKEN secret (a GitHub App installation token or a fine-grained token with contents and
|
||||
# pull-requests write) for CI to run on them.
|
||||
# Pull requests opened with the default GITHUB_TOKEN don't start other workflows, so the run
|
||||
# signs in as the "Cottage catalog bot" GitHub App (installed on this repository only, contents
|
||||
# and pull-requests write): the BUMP_APP_ID variable and the BUMP_APP_KEY secret (its private key).
|
||||
on:
|
||||
schedule: [{ cron: "17 6 * * *" }]
|
||||
workflow_dispatch:
|
||||
@@ -11,12 +11,17 @@ jobs:
|
||||
bump:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/create-github-app-token@v2
|
||||
id: app
|
||||
with:
|
||||
app-id: ${{ vars.BUMP_APP_ID }}
|
||||
private-key: ${{ secrets.BUMP_APP_KEY }}
|
||||
- uses: actions/checkout@v4
|
||||
with: { fetch-depth: 0, token: "${{ secrets.BUMP_TOKEN || secrets.GITHUB_TOKEN }}" }
|
||||
with: { fetch-depth: 0, token: "${{ steps.app.outputs.token }}" }
|
||||
- run: pip install --quiet pyyaml
|
||||
- name: Open bump pull requests
|
||||
env: { GH_TOKEN: "${{ secrets.BUMP_TOKEN || secrets.GITHUB_TOKEN }}" }
|
||||
env: { GH_TOKEN: "${{ steps.app.outputs.token }}" }
|
||||
run: |
|
||||
git config user.name "Cottage catalog bot"
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git config user.name "cottage-catalog-bot[bot]"
|
||||
git config user.email "5885297+cottage-catalog-bot[bot]@users.noreply.github.com"
|
||||
python3 scripts/bump.py run
|
||||
Reference in new issue
Block a user