ignore #60
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Close Issues | |
on: | |
issues: | |
types: [opened] | |
jobs: | |
close_issue: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install jq | |
run: sudo apt-get install -y jq | |
- name: Check issue body for regex | |
id: check_regex | |
run: | | |
ISSUE_BODY=$(echo "${{ github.event.issue.body }}" | jq -Rr @sh) | |
if [[ ! $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' | |
}) |