Skip to content

Commit 39e02a3

Browse files
Merge pull request #37 from prgrms-web-devcourse-final-project/BackSeungBeom-patch-1
[BE/frefactor] auto-close-issues.yml 추가
2 parents 3eaa0f4 + 104a469 commit 39e02a3

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Auto Close Issues on Dev Merge
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
branches:
7+
- dev
8+
9+
jobs:
10+
close-issues:
11+
if: github.event.pull_request.merged == true
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Extract issue numbers from PR body
16+
id: extract
17+
run: |
18+
echo "PR Body:"
19+
echo "${{ github.event.pull_request.body }}"
20+
21+
# extract "#숫자" 패턴만 추출
22+
ISSUES=$(echo "${{ github.event.pull_request.body }}" | grep -oE '#[0-9]+' | tr -d '#')
23+
24+
echo "ISSUES=$ISSUES" >> $GITHUB_ENV
25+
26+
- name: Close issues
27+
uses: peter-evans/close-issue@v4
28+
if: env.ISSUES != ''
29+
with:
30+
issue-number: ${{ env.ISSUES }}
31+
comment: "Automatically closed because the related PR was merged into dev."
32+
state: closed
33+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)