Skip to content

[노철] - 계획 수정페이지 디자인 변경 #125

[노철] - 계획 수정페이지 디자인 변경

[노철] - 계획 수정페이지 디자인 변경 #125

Workflow file for this run

name: Close associated issue
on:
pull_request:
branches:
- dev
types:
- closed
jobs:
close-issue:
runs-on: ubuntu-latest
steps:
- name: Close associated issue
run: |
PR_NUMBER=${{ github.event.pull_request.number }}
PR_URL="https://api.github.com/repos/${{ github.repository }}/pulls/$PR_NUMBER"
echo "PR_URL: $PR_URL"
PR_BODY=$(curl -s -H "Authorization: token ${{ secrets.ACTION_TOKEN }}" $PR_URL | jq -r '.body')
echo "PR_BODY: $PR_BODY"
ISSUE_NUMBER=$(echo $PR_BODY | grep -oE "close #[0-9]+" | tr -d 'close #')
echo "ISSUE_NUMBER: $ISSUE_NUMBER"
if [[ ! -z "$ISSUE_NUMBER" ]]; then
curl -s -H "Authorization: token ${{ secrets.ACTION_TOKEN }}" -X PATCH "https://api.github.com/repos/${{ github.repository }}/issues/$ISSUE_NUMBER" -d '{"state": "closed"}'
fi
shell: bash