Skip to content

Fe/feature/#602 카카오톡 로그아웃 기능 #35

Fe/feature/#602 카카오톡 로그아웃 기능

Fe/feature/#602 카카오톡 로그아웃 기능 #35

Workflow file for this run

name: Close Issue When PR Closed
on:
pull_request:
types:
- closed
jobs:
close-issue:
name: Close Issue
if: github.event.pull_request.base.ref != 'release'
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
with:
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
script: |
const branchName = context.payload.pull_request.head.ref;
const issueNumbers = branchName.match(/#(\d+)/g);
for(const num of issueNumbers) {
const issueNumber = num.replace('#', '');
const res = await github.rest.issues.get({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
});
const subIssues = res?.data.body
?.match(/#(\d+)/g)
?.forEach((issue) => issueNumbers.push(issue.replace('#', '')));
}
issueNumbers?.forEach((num) => {
github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: num.replace('#', ''),
state: 'closed',
});
});