Download .forge/skills/write-release-notes/scripts/validate-release-notes.sh from SaylorTwift/forgecode: direct link, hf CLI and curl.
- Browser
- Download file 708 Bytes
-
https://huggingface.co/SaylorTwift/forgecode/resolve/main/.forge/skills/write-release-notes/scripts/validate-release-notes.sh
- Command line
-
hf download hf://SaylorTwift/forgecode/.forge/skills/write-release-notes/scripts/validate-release-notes.sh
-
curl -L -o validate-release-notes.sh https://huggingface.co/SaylorTwift/forgecode/resolve/main/.forge/skills/write-release-notes/scripts/validate-release-notes.sh
708 Bytes
| # Validates release notes piped via stdin or passed as a file argument. | |
| # Usage: | |
| # echo "..." | bash validate-release-notes.sh | |
| # bash validate-release-notes.sh release-notes.md | |
| # | |
| # Exit codes: | |
| # 0 — valid (under 2000 characters) | |
| # 1 — invalid (2000 characters or over) | |
| set -euo pipefail | |
| MAX_CHARS=2000 | |
| if [[ $# -ge 1 ]]; then | |
| content=$(cat "$1") | |
| else | |
| content=$(cat) | |
| fi | |
| char_count=${#content} | |
| if [[ $char_count -lt $MAX_CHARS ]]; then | |
| echo "PASS: $char_count characters (limit: $MAX_CHARS)" | |
| exit 0 | |
| else | |
| echo "FAIL: $char_count characters — exceeds limit of $MAX_CHARS" >&2 | |
| echo "Trim $(($char_count - $MAX_CHARS)) more character(s) to pass." >&2 | |
| exit 1 | |
| fi | |