Skip to content

Commit

Permalink
issue it!
Browse files Browse the repository at this point in the history
  • Loading branch information
fujiwara committed Apr 14, 2023
1 parent 7a9dcc5 commit 9a0a870
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,7 @@ runs:
$output
END
)
# Check if an issue with the same title already exists
existing_issue=$(gh issue list --search "$issue_title" --state open --json 'number,body' -q '.[] | .number')
if [ -z "$existing_issue" ]; then
# Check if there's a closed issue with the same title
last_closed_issue=$(gh issue list --search 'RI Expiring in 1 Days' --state closed --json number,body | jq '[.[] | {number: .number, body: .body}] | first')
if [[ "$last_closed_issue" == "null" ]]; then
# Create a new issue only if no open issue exists and there is no closed issue with the same title
gh issue create --title "$issue_title" --body "$issue_body"
else
echo "A closed issue with the same title already exists: Issue #$last_closed_issue"
fi
else
echo "An open issue with the same title already exists: Issue #$existing_issue"
fi
gh issue create --title "$issue_title" --body "$issue_body"
shell: bash
env:
GITHUB_TOKEN: ${{ github.token }}

0 comments on commit 9a0a870

Please sign in to comment.