Skip to content

Commit

Permalink
Only allow token authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
Justintime50 committed May 4, 2020
1 parent ff47710 commit 75cebfa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .config.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Your username or organization name.
USERNAME=""

# Your password or a token if 2FA is enabled.
# Your GitHub personal access token (allows for private repos)
TOKEN=""

# Enter "enable" to clone personal repos (clone_on must also be enabled). Default: "enable"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ The power of GitHub Archive comes in its configuration. Maybe you only want to c

## Install

This project requires that you have Python installed. Python comes built-in on macOS and Linux.
**NOTE:** This project requires that you have Python installed. Python usually comes built-in on macOS and Linux.

```bash
# Copy the configuration file and edit for your needs.
cp .config.example .config
```

**For Private Repos:** You must have an SSH key generated on your local machine and added to GitHub.
**For Private Repos:** You must have an SSH key generated on your local machine and added to your GitHub account.

### Automating SSH Passphrase Prompt (Recommended)

Expand Down
2 changes: 1 addition & 1 deletion github-archive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ cd "$LOCATION"/repos || exit
echo -e "Cloning $ORG repos..."
mkdir -p "$LOCATION"/repos/"$ORG"
cd "$LOCATION"/repos/"$ORG" || exit
curl -s -u "$USERNAME":"$TOKEN" "https://api.github.com/orgs/$ORG/repos?page=$PAGE&per_page=$PER_PAGE" |
curl -s -H "Authorization: token $TOKEN" "https://api.github.com/orgs/$ORG/repos?page=$PAGE&per_page=$PER_PAGE" |
python -c $'import json, sys, os\nfor repo in json.load(sys.stdin): os.system("git clone " + repo["ssh_url"])'
cd .. || exit
echo -e "$ORG repos cloned!\n"
Expand Down

0 comments on commit 75cebfa

Please sign in to comment.