Skip to content

Commit e3e555e

Browse files
committed
rm useless github token for our public repository
1 parent f1111be commit e3e555e

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

.d4g-tools/deploy/pull/pull_cron.sh

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ report_github_status() {
4141
debug "COMMIT_SHA: $COMMIT_SHA"
4242
debug "STATUS: $STATUS"
4343
debug "DESCRIPTION: $DESCRIPTION"
44-
curl -s -H "Authorization: token ${GITHUB_TOKEN}" -X POST \
44+
curl -s -X POST \
4545
-d "{\"state\": \"${STATUS}\", \"description\": \"$DESCRIPTION\", \"context\": \"deploy\"}" \
4646
"https://api.github.com/repos/${REPOSITORY_NAME}/statuses/${COMMIT_SHA}" >/dev/null
4747
}
@@ -139,16 +139,11 @@ parse_params() {
139139

140140
debug "DEBUG: $DEBUG"
141141
debug "RUN_DIR: $RUN_DIR"
142-
debug "GITHUB_TOKEN: $GITHUB_TOKEN"
143142
debug "REPOSITORY_NAME: $REPOSITORY_NAME"
144143
debug "BRANCH: $BRANCH"
145144
debug "DEPLOY_SCRIPT: $DEPLOY_SCRIPT"
146145
debug "LOCK_LOCATION: $LOCK_LOCATION"
147146

148-
if [ -z "${GITHUB_TOKEN}" ]; then
149-
error "Github token is required."
150-
usage
151-
fi
152147
if [ -z "${REPOSITORY_NAME}" ]; then
153148
error "Repository name is required."
154149
usage
@@ -160,7 +155,7 @@ parse_params() {
160155
parse_params "$@"
161156

162157
# Check if a new commit exists
163-
HEAD_COMMIT=$(curl -s -H "Authorization: token ${GITHUB_TOKEN}" "https://api.github.com/repos/${REPOSITORY_NAME}/commits/${BRANCH}" | jq -r '.sha')
158+
HEAD_COMMIT=$(curl -s "https://api.github.com/repos/${REPOSITORY_NAME}/commits/${BRANCH}" | jq -r '.sha')
164159
LOCAL_COMMIT=$(cd $SOURCE && git rev-parse HEAD)
165160

166161
debug "HEAD_COMMIT: $HEAD_COMMIT"

0 commit comments

Comments
 (0)