Skip to content

Commit

Permalink
Update close-issue-when-done
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanstrominger authored Jan 13, 2024
1 parent dd03e1f commit ce00684
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/close-issue-when-done
Original file line number Diff line number Diff line change
@@ -1 +1,28 @@
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'
});

0 comments on commit ce00684

Please sign in to comment.