Download ARTEX-main/scripts/test-bot-context.sh from ghostai1/WardenPEN: direct link, hf CLI and curl.
- Browser
- Download file 1.23 kB
-
https://huggingface.co/ghostai1/WardenPEN/resolve/main/ARTEX-main/scripts/test-bot-context.sh
- Command line
-
hf download hf://ghostai1/WardenPEN/ARTEX-main/scripts/test-bot-context.sh
-
curl -L -o test-bot-context.sh https://huggingface.co/ghostai1/WardenPEN/resolve/main/ARTEX-main/scripts/test-bot-context.sh
1.23 kB
| # Guards the triage bot's repository summary (.github/scripts/bot.sh, | |
| # repo_context). Every top-level directory must be visible in it: an earlier | |
| # version printed the first 120 tracked paths alphabetically, which stopped at | |
| # config/ and made the bot tell a contributor that docs/ and scripts/benchmark/ | |
| # do not exist. | |
| set -uo pipefail | |
| cd "$(dirname "$0")/.." || exit 1 | |
| eval "$(sed -n '/^repo_context()/,/^}$/p' .github/scripts/bot.sh)" | |
| [ "$(type -t repo_context)" = "function" ] || { echo "repo_context not found in bot.sh"; exit 1; } | |
| out=$(repo_context) || { echo "repo_context failed"; exit 1; } | |
| [ -n "$out" ] || { echo "repo_context printed nothing"; exit 1; } | |
| status=0 | |
| while read -r dir; do | |
| case "$out" in | |
| *" $dir/"*) ;; | |
| *) echo "missing top-level directory in the bot summary: $dir"; status=1 ;; | |
| esac | |
| done < <(git ls-files | awk -F/ 'NF >= 2 { print $1 }' | sort -u) | |
| # The two paths the truncated list used to hide, asserted by name. | |
| for path in docs scripts/benchmark; do | |
| case "$out" in | |
| *" $path/"*) ;; | |
| *) echo "missing from the bot summary: $path/"; status=1 ;; | |
| esac | |
| done | |
| [ "$status" = 0 ] && echo "ok: the bot summary exposes every top-level directory" | |
| exit "$status" | |