From 5f7ed2b3543efba44f89e78c74c07738fb36efec Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Thu, 9 May 2024 11:05:17 +0900 Subject: [PATCH] ci: use enable-auto-merge-action --- .github/workflows/wc-enable-auto-merge.yaml | 23 +++++---------------- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/.github/workflows/wc-enable-auto-merge.yaml b/.github/workflows/wc-enable-auto-merge.yaml index 2710b70d2..6d093aca1 100644 --- a/.github/workflows/wc-enable-auto-merge.yaml +++ b/.github/workflows/wc-enable-auto-merge.yaml @@ -13,22 +13,9 @@ jobs: runs-on: ubuntu-latest permissions: {} steps: - - name: Generate token - id: generate_token - uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0 + - uses: suzuki-shunsuke/enable-auto-merge-action@ec074392e76cd1062925255cd82a86ea1c44b6fd # v0.1.0 with: - app_id: ${{secrets.gh_app_id}} - private_key: ${{secrets.gh_app_private_key}} - permissions: >- - { - "contents": "write", - "pull_requests": "write" - } - repositories: >- - [ - "${{github.event.repository.name}}" - ] - - run: gh -R "$GITHUB_REPOSITORY" pr merge --squash --auto --delete-branch "$PR_NUMBER" - env: - GITHUB_TOKEN: ${{steps.generate_token.outputs.token}} # Use GitHub App to trigger GitHub Actions Workflow by merge commit. - PR_NUMBER: ${{github.event.pull_request.number}} + pr_number: ${{github.event.pull_request.number}} + merge_method: squash + github_app_id: ${{secrets.gh_app_id}} + github_app_private_key: ${{secrets.gh_app_private_key}}