diff --git a/.github/workflows/auto_merge.yml b/.github/workflows/auto_merge.yml new file mode 100644 index 00000000..2d8cbce2 --- /dev/null +++ b/.github/workflows/auto_merge.yml @@ -0,0 +1,26 @@ +name: auto merge PR + +on: + pull_request: + branches: + - main + workflow_dispatch: + +permissions: + pull-requests: write + contents: write + +jobs: + auto_merge: + runs-on: ubuntu-latest + # 自分が作成したPRでのみ有効化する + if: ${{ github.actor == 'Seasawher' }} + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Merge PR + run: | + gh pr merge --merge --auto "$PR_URL"