Created
April 3, 2025 22:08
-
-
Save pathikrit/fee5e757a02e048ecf25959cd9f82f47 to your computer and use it in GitHub Desktop.
uv Run scripts from a private github repo
This file contains hidden or 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
#!/bin/bash | |
# Usage: ./uv_github.sh <path_to_script> [args...] | |
ORG="pathikrit" | |
REPO="scripts" | |
if [ "$#" -lt 1 ]; then | |
echo "Usage: $0 <path_to_script> [args...]" | |
exit 1 | |
fi | |
PATH_TO_SCRIPT="$1" | |
shift | |
tmpfile=$(mktemp "/tmp/$(basename "$PATH_TO_SCRIPT").XXXXXX") | |
gh api repos/"$ORG"/"$REPO"/contents/"$PATH_TO_SCRIPT" \ | |
| jq -r .content \ | |
| base64 --decode > "$tmpfile" | |
uv run "$tmpfile" "$@" | |
rm "$tmpfile" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment