utils: forks: use github token to create repos
Password authentication will stop to work on November 13, 2020
https://developer.github.com/changes/2020-02-14-deprecating-password-auth/
Change-Id: Ic8188d370b20d74c5b21dba56b29b6e23c57126d
diff --git a/utils/fork_github.sh b/utils/fork_github.sh
index c4b9a42..535d4c9 100755
--- a/utils/fork_github.sh
+++ b/utils/fork_github.sh
@@ -12,6 +12,7 @@
# Configuration
##
USERNAME=<INSERT USER>
+TOKEN=<INSERT TOKEN>
BRANCH=android-7.1
GERRIT=gerrit.omnirom.org
GITHUB_ORG=omnirom
@@ -35,7 +36,7 @@
# Create the new repository on the organization
echo Creating $repo_name on GitHub
-curl --user $USERNAME --data "{\"name\":\"$repo_name\"}" https://api.github.com/orgs/$GITHUB_ORG/repos
+curl -H 'Authorization: token '$TOKEN'' --data "{\"name\":\"$repo_name\"}" https://api.github.com/orgs/$GITHUB_ORG/repos
# Create the repository on Gerrit
echo Creating $repo_name on Gerrit