From 3bc70d750388e59e63400598eb78f2c46f873b8a Mon Sep 17 00:00:00 2001 From: Nikita Date: Wed, 15 May 2024 11:13:51 +0200 Subject: [PATCH] ci: use github app for CI --- .github/workflows/codegen-api-types.yml | 12 ++++++++---- .github/workflows/deno-task-cdnup.yml | 9 +++++++-- .github/workflows/release-please.yml | 7 ++++++- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/.github/workflows/codegen-api-types.yml b/.github/workflows/codegen-api-types.yml index a0ff8d0..489deb3 100644 --- a/.github/workflows/codegen-api-types.yml +++ b/.github/workflows/codegen-api-types.yml @@ -3,7 +3,7 @@ name: Generate API types on: workflow_dispatch: schedule: - - cron: "0 0 * * 1" + - cron: "0 0 * * 0" permissions: contents: write @@ -15,12 +15,16 @@ jobs: steps: - uses: actions/checkout@v4 - uses: denoland/setup-deno@v1 - with: - deno-version: v1.x - run: deno task codegen + - uses: actions/create-github-app-token@v1 + id: create-token + with: + app-id: ${{ vars.APP_ID }} + private-key: ${{ secrets.PRIVATE_KEY }} - uses: peter-evans/create-pull-request@v6 with: - token: ${{ secrets.PAT }} + token: ${{ steps.create-token.outputs.token }} branch: "update-api-types" commit-message: "chore: generate latest Bot API types" + # TODO: Automatically insert Bot API version title: "feat: update Bot API types" diff --git a/.github/workflows/deno-task-cdnup.yml b/.github/workflows/deno-task-cdnup.yml index 8703b53..537326f 100644 --- a/.github/workflows/deno-task-cdnup.yml +++ b/.github/workflows/deno-task-cdnup.yml @@ -3,7 +3,7 @@ name: Update CDN dependencies on: workflow_dispatch: schedule: - - cron: "0 0 * * 0" + - cron: "0 0 1 * *" permissions: contents: write @@ -18,9 +18,14 @@ jobs: - run: deno task cdnup - run: deno test --no-run # update lock file continue-on-error: true + - uses: actions/create-github-app-token@v1 + id: create-token + with: + app-id: ${{ vars.APP_ID }} + private-key: ${{ secrets.PRIVATE_KEY }} - uses: peter-evans/create-pull-request@v6 with: - token: ${{ secrets.PAT }} + token: ${{ steps.create-token.outputs.token }} branch: "update-cdn-deps" commit-message: "chore: update CDN dependencies" title: "chore: update CDN dependencies" diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index e9bfadd..65b5cef 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -13,7 +13,12 @@ jobs: release: runs-on: ubuntu-latest steps: + - uses: actions/create-github-app-token@v1 + id: create-token + with: + app-id: ${{ vars.APP_ID }} + private-key: ${{ secrets.PRIVATE_KEY }} - uses: google-github-actions/release-please-action@v4 with: - token: ${{ secrets.PAT }} + token: ${{ steps.create-token.outputs.token }} release-type: simple