Skip to content

Commit

Permalink
Create issues.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisnojima authored Sep 3, 2024
1 parent 5d7ce50 commit 65aac08
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Close Issues
on:
issues:
types: [opened]

jobs:
close_issue:
runs-on: ubuntu-latest

steps:
- name: Check issue body for regex
id: check_regex
run: |
if [[ ! "${{ github.event.issue.body }}" =~ 345567 ]]; then
echo "::set-output name=should_close::true"
else
echo "::set-output name=should_close::false"
fi
- name: Close issue
if: steps.check_regex.outputs.should_close == 'true'
uses: actions/github-script@v6
with:
script: |
github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
state: 'closed'
})

0 comments on commit 65aac08

Please sign in to comment.