Download goalert/devtools/scripts/github-set-pr-label.sh from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 563 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/goalert/devtools/scripts/github-set-pr-label.sh
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@f5071caa249115f3b590492f1c8eb471e02aae4b/goalert/devtools/scripts/github-set-pr-label.sh
-
curl -L -o github-set-pr-label.sh https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/goalert/devtools/scripts/github-set-pr-label.sh
563 Bytes
| set -e | |
| if [ -z "PR_NUMBER" ]; then | |
| echo "PR_NUMBER is not set" | |
| exit 1 | |
| fi | |
| MY_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
| LABEL=$("$MY_DIR/git-diff-label-calc.sh" --debug) | |
| # Remove any existing test/* labels | |
| for label in $(gh pr view "$PR_NUMBER" --json labels --jq '.labels[] | select(.name | startswith("size/")) | .name'); do | |
| if [ "$label" == "$LABEL" ]; then | |
| continue # Skip the label we want to add | |
| fi | |
| gh pr edit "$PR_NUMBER" --remove-label "$label" | |
| done | |
| gh pr edit "$PR_NUMBER" --add-label "$LABEL" | |