From 25bebd68a28fa0b56017a1b411c9ca252a19a072 Mon Sep 17 00:00:00 2001 From: monosans Date: Fri, 2 Feb 2024 15:51:24 +0300 Subject: [PATCH] Improve GitHub Actions automations --- .github/dependabot.yml | 6 +++--- .github/workflows/auto-merge.yml | 6 +++--- .github/workflows/update-dependencies.yml | 12 ++++++++---- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ffc588c..c16841b 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,17 +4,17 @@ updates: directory: / schedule: interval: daily - time: "02:30" + time: "00:30" - package-ecosystem: github-actions directory: / schedule: interval: daily - time: "02:30" + time: "00:30" - package-ecosystem: pip directory: / schedule: interval: daily - time: "02:30" + time: "00:30" groups: pip-semver-minor: patterns: diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml index 24641d3..0f18606 100644 --- a/.github/workflows/auto-merge.yml +++ b/.github/workflows/auto-merge.yml @@ -16,12 +16,12 @@ jobs: run: gh pr merge --auto --delete-branch --squash "${PR_URL}" env: PR_URL: ${{ github.event.pull_request.html_url }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} auto-merge-updates: runs-on: ubuntu-latest - if: ${{ github.actor == 'monosans' && startsWith(github.head_ref, 'update/') }} + if: ${{ github.actor_id == secrets.APP_ID }} steps: - run: gh pr merge --auto --delete-branch --squash "${PR_URL}" env: PR_URL: ${{ github.event.pull_request.html_url }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/update-dependencies.yml b/.github/workflows/update-dependencies.yml index 9614468..3080bc7 100644 --- a/.github/workflows/update-dependencies.yml +++ b/.github/workflows/update-dependencies.yml @@ -2,7 +2,7 @@ name: Update dependencies on: workflow_dispatch: schedule: - - cron: 30 3 * * * + - cron: 30 1 * * * concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true @@ -21,12 +21,16 @@ jobs: steps: - uses: actions/checkout@v4 - run: ${{ matrix.cmd }} + - id: generate-token + uses: tibdex/github-app-token@v2 + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.PRIVATE_KEY }} - uses: peter-evans/create-pull-request@v6 with: - token: ${{ secrets.PAT }} + token: ${{ steps.generate-token.outputs.token }} commit-message: ${{ matrix.commit-msg }} - committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> - author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> branch: ${{ matrix.branch }} + delete-branch: true title: ${{ matrix.commit-msg }} body: