diff --git a/.github/workflows/auto-merge-pr.yml b/.github/workflows/auto-merge-pr.yml new file mode 100644 index 0000000..5ad0ab1 --- /dev/null +++ b/.github/workflows/auto-merge-pr.yml @@ -0,0 +1,32 @@ +name: Auto-merge PR from ddrayko + +on: + pull_request_target: + types: [opened, edited, synchronize, reopened] + +permissions: + contents: write + pull-requests: write + +jobs: + auto-merge: + if: github.event.pull_request.user.login == 'ddrayko' + runs-on: ubuntu-latest + steps: + - name: Check PR title format + id: check_title + env: + TITLE: ${{ github.event.pull_request.title }} + run: | + if echo "$TITLE" | grep -qE '^v[0-9]+\.[0-9]+\.[0-9]+$'; then + echo "match=true" >> "$GITHUB_OUTPUT" + else + echo "match=false" >> "$GITHUB_OUTPUT" + fi + + - name: Auto-merge + if: steps.check_title.outputs.match == 'true' + env: + GH_TOKEN: ${{ secrets.BOT_TOKEN }} + run: | + gh pr merge "${{ github.event.pull_request.html_url }}" --merge --auto diff --git a/README.md b/README.md index c03d2b8..0314a2f 100644 --- a/README.md +++ b/README.md @@ -561,3 +561,4 @@ Both use SSH credentials configured as GitHub repository secrets (`SSH_HOST`, `S ## GitHub Stats ![Alt](https://repobeats.axiom.co/api/embed/2f957f930d36f4a2913f8aeb07712cedbd4b38c5.svg "Repobeats analytics image") +