Skip to content

Commit 07a5866

Browse files
committed
Add auto-merge workflow for ddrayko PRs with versioned titles
1 parent ecd8863 commit 07a5866

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Auto-merge PR from ddrayko
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, edited, synchronize, reopened]
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
auto-merge:
13+
if: github.event.pull_request.user.login == 'ddrayko'
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Check PR title format
17+
id: check_title
18+
env:
19+
TITLE: ${{ github.event.pull_request.title }}
20+
run: |
21+
if echo "$TITLE" | grep -qE '^v[0-9]+\.[0-9]+\.[0-9]+$'; then
22+
echo "match=true" >> "$GITHUB_OUTPUT"
23+
else
24+
echo "match=false" >> "$GITHUB_OUTPUT"
25+
fi
26+
27+
- name: Auto-merge
28+
if: steps.check_title.outputs.match == 'true'
29+
env:
30+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
run: |
32+
gh pr merge "${{ github.event.pull_request.html_url }}" --merge --auto

0 commit comments

Comments
 (0)