feat: PR이 닫힐 때 체크리스트가 완료된 경우 링크된 이슈 자동 닫기 기능 추가 #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Close Linked Issues if Checklist Complete | |
| on: | |
| pull_request: | |
| types: [closed] | |
| permissions: | |
| issues: write | |
| pull-requests: read | |
| contents: read | |
| jobs: | |
| close-linked-issues: | |
| if: github.event.pull_request.merged == true | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check if checklist is fully complete | |
| id: checklist | |
| run: | | |
| BODY="${{ github.event.pull_request.body }}" | |
| UNCHECKED=$(echo "$BODY" | grep -c '\[ \]') | |
| if [ "$UNCHECKED" -eq 0 ]; then | |
| echo "checklist-complete=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "checklist-complete=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Close linked issues if checklist is complete | |
| if: steps.checklist.outputs.checklist-complete == 'true' | |
| uses: peter-evans/close-issue@v3 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} |