-
-
Notifications
You must be signed in to change notification settings - Fork 641
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): π add appropriate labels to PRs with failed checks (#2793)
Signed-off-by: Okinea Dev <[email protected]> Co-authored-by: Okinea Dev <[email protected]>
- Loading branch information
Showing
5 changed files
with
52 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Only for GitHub Actions | ||
# Parameters: <pr_number> <status> <label> | ||
# Example: ./update-status-label.sh 1234 failure "invalid-colors" | ||
|
||
# Exit on error | ||
set -e | ||
|
||
pr_number="$1" | ||
status="$2" | ||
label="$3" | ||
|
||
action="add-label" && [ "$status" == "success" ] && action="remove-label" | ||
|
||
# Add or remove label | ||
export GH_TOKEN="$GITHUB_TOKEN" | ||
gh pr edit "$pr_number" --$action "$label" | ||
|
||
[ "$action" == "add-label" ] && echo "β Added \"$label\" label to PR #$pr_number" | ||
[ "$action" == "remove-label" ] && echo "β Removed \"$label\" label from PR #$pr_number" | ||
|
||
# 0 = success | ||
exit 0 |
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
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