Last active
April 25, 2022 21:30
-
-
Save steinbrueckri/9d5b45f5134caa6e680259179e7db091 to your computer and use it in GitHub Desktop.
Create file in GitHub Repo via API - Example
This file contains 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 | |
MESSAGE="test" | |
TOKEN=$(cat ~/.github-token) | |
FILENAME="$RANDOM-date.txt" | |
CONTENT=$(date | base64) | |
USER="steinbrueckri" | |
REPO="api-test" | |
MESSAGE="hello world" | |
http PUT https://api.github.com/repos/$USER/$REPO/contents/$FILENAME \ | |
Authorization:" token $TOKEN" \ | |
message="$MESSAGE" \ | |
content="$CONTENT" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment