feat: add --raw flag to github-app-token and clean up docs
- Add --raw flag that prints only the token value (no export wrapper), making GH_TOKEN=$(./generate_token.sh --raw) the recommended pattern for AI agents and CI/CD. - Clean up die() to only write to stderr (remove eval-safe stdout hack). - Fix SKILL.md: correct step numbering, remove unused grep prerequisite, replace placeholder paths, lead with --raw usage, move eval to legacy. - Update CLAUDE.md to reflect new --raw pattern. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -8,9 +8,17 @@
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# Parse flags
|
||||
RAW_MODE=false
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
--raw) RAW_MODE=true ;;
|
||||
*) echo "error: unknown flag: $arg" >&2; exit 1 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
die() {
|
||||
echo "error: $1" >&2
|
||||
echo "return 1 2>/dev/null || false"
|
||||
exit 1
|
||||
}
|
||||
|
||||
@@ -62,5 +70,9 @@ if [[ -z "${INSTALL_TOKEN}" ]]; then
|
||||
die "failed to generate installation token. Response: ${RESPONSE}"
|
||||
fi
|
||||
|
||||
# Output the export command so it can be eval'd by the caller
|
||||
echo "export GH_TOKEN=\"${INSTALL_TOKEN}\""
|
||||
# Output the token
|
||||
if [[ "$RAW_MODE" == true ]]; then
|
||||
printf '%s' "${INSTALL_TOKEN}"
|
||||
else
|
||||
echo "export GH_TOKEN=\"${INSTALL_TOKEN}\""
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user