Skip to content

test_issue

test_issue #64

name: Auto Close Issue when all tasks are completed
on:
issue_comment:
types: [created, edited]
issues:
types: [opened, edited]
jobs:
check-tasks-and-close-issue:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Check if all tasks are completed and close issue
id: check-tasks
run: |
ISSUE_NUMBER="${{ github.event.issue.number }}"
OWNER="${{ github.repository_owner }}"
REPO="${{ github.repository }}"
GITHUB_TOKEN="${{ secrets.GITHUB_TOKEN }}"
# API를 사용하여 이슈를 닫음
curl -X PATCH -H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/zizzic/main_repo/issues/$ISSUE_NUMBER" \
-d '{"state":"closed"}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}