Skip to content

Close Issue on Done

Close Issue on Done #2

name: Close Issue on Done
on:
project_card:
types:
- moved
jobs:
close-issue:
runs-on: ubuntu-latest
steps:
- name: Check if in "done" column
id: check-done-column
run: echo "::set-output name=isDone::${{ contains(github.event.project_card.column_name, 'done') }}"
- name: Close Issue
if: steps.check-done-column.outputs.isDone == 'true'
uses: actions/github-script@v5
with:
script: |
const issueId = context.payload.project_card.content_url.split('/').pop();
await github.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueId,
state: 'closed'
});