-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2654 from KaiSzuttor/ci_issue
Automatic closing of CI created issues part 2
- Loading branch information
Showing
3 changed files
with
25 additions
and
3 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
ISSUE_NUMBER=$(curl -s -G https://api.github.com/search/issues \ | ||
--data-urlencode "q=\"CI failed for merged PR\" org:espressomd repo:espresso is:open is:issue in:title" \ | ||
--data-urlencode "q=${CI_PIPELINE_ID} org:espressomd repo:espresso is:open is:issue in:body" | jq '.items[0] .number') | ||
|
||
if [ "$ISSUE_NUMBER" != "null" ]; then | ||
curl -s "https://api.github.com/repos/espressomd/espresso/issues/$ISSUE_NUMBER" \ | ||
-H "Accept: application/vnd.github.full+json" \ | ||
-H "Content-Type: application/json" \ | ||
-H "Authorization: token $GITHUB_TOKEN" \ | ||
-X PATCH \ | ||
-d "{\"state\": \"closed\" }" | ||
fi |
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