diff --git a/.github/workflows/update-t3code.yml b/.github/workflows/update-t3code.yml index 68c3b78..977f67f 100644 --- a/.github/workflows/update-t3code.yml +++ b/.github/workflows/update-t3code.yml @@ -6,8 +6,8 @@ on: workflow_dispatch: permissions: - contents: write - pull-requests: write + contents: read + pull-requests: read concurrency: group: update-t3code @@ -42,17 +42,27 @@ jobs: echo "open=true" >> "$GITHUB_OUTPUT" fi + - name: Create bot token + if: steps.existing.outputs.open != 'true' + id: bot + uses: actions/create-github-app-token@v3 + with: + client-id: ${{ vars.BOT_CLIENT_ID }} + private-key: ${{ secrets.BOT_PRIVATE_KEY }} + + # The bot opens the PR so validation starts on its own. - name: Open update pull request if: steps.existing.outputs.open != 'true' uses: peter-evans/create-pull-request@v8 with: + token: ${{ steps.bot.outputs.token }} add-paths: | flatpak/modules/t3code.yml flatpak/com.t3tools.t3code.metainfo.xml branch: automation/update-t3code-${{ steps.release.outputs.result }} delete-branch: true draft: true - # Bot-created PRs don't notify anyone unless a person is requested. + # Notifies me of each update, since the PR needs its patches refreshed by hand. reviewers: TB516 commit-message: "chore(flatpak): update T3 Code to ${{ steps.release.outputs.result }}" title: "chore(flatpak): update T3 Code to ${{ steps.release.outputs.result }}" diff --git a/docs/publishing.md b/docs/publishing.md index c5f989b..9465a4d 100644 --- a/docs/publishing.md +++ b/docs/publishing.md @@ -23,8 +23,10 @@ message, so PR titles use the `type(scope): description` format, such as `chore(flatpak): update T3 Code to v0.1.7`. **Validate Flatpak update** runs when packaging PRs are opened, updated, or -reopened. It can also be started from the Actions tab. GitHub requires approval -for runs triggered by the updater's `GITHUB_TOKEN`; approve them in the PR. +reopened. It can also be started from the Actions tab. The updater opens PRs +as the `tbot516` GitHub App, so validation starts on its own. Install the app +on this repository and store its client ID as the Actions variable +`BOT_CLIENT_ID` and its private key as the Actions secret `BOT_PRIVATE_KEY`. New commits cancel older validation runs for the same PR. Website-only changes skip package validation and do not change the build cache key. The workflow applies the patches, builds the Flatpak, runs desktop tests and