From 22935d691f3a6848e1667016d62007316ed2b3c4 Mon Sep 17 00:00:00 2001 From: Doeunnkimm Date: Thu, 20 Jun 2024 23:33:19 +0900 Subject: [PATCH] fix --- .github/workflows/auto-merge.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml index b39c71b5..e8c3e011 100644 --- a/.github/workflows/auto-merge.yml +++ b/.github/workflows/auto-merge.yml @@ -10,7 +10,7 @@ on: jobs: auto-merge: runs-on: ubuntu-latest - if: github.event.action == 'submitted' || github.event.action == 'labeled' || github.event.action == 'unlabeled' + steps: - name: Checkout repository uses: actions/checkout@v2 @@ -47,7 +47,10 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Merge Pull Request on Review - if: github.event.action == 'submitted' && github.event.review.state == 'approved' && env.NO_AUTO_MERGE == 'false' + if: | + github.event_name == 'pull_request_review' && + github.event.review.state == 'approved' && + env.NO_AUTO_MERGE == 'false' uses: actions/github-script@v6 with: script: | @@ -66,7 +69,10 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Merge Pull Request on Label - if: github.event.action == 'labeled' && env.NO_AUTO_MERGE == 'false' + if: | + github.event_name == 'pull_request' && + github.event.action == 'labeled' && + env.NO_AUTO_MERGE == 'false' uses: actions/github-script@v6 with: script: | @@ -95,7 +101,10 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Merge Pull Request on Unlabel - if: github.event.action == 'unlabeled' && github.event.label.name == 'no auto merge' + if: | + github.event_name == 'pull_request' && + github.event.action == 'unlabeled' && + github.event.label.name == 'no auto merge' uses: actions/github-script@v6 with: script: |