File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -135,5 +135,16 @@ curl -sS --fail -X PUT --header "Content-Type: application/json" \
135135 -d ' {"feature_flags":{"build-fork-prs":true}}' \
136136 " https://circleci.com/api/v1.1/project/github/${EXCHANGE_ORG} /${REPO_NAME} /settings?circle-token=${CIRCLECI_TOKEN} "
137137
138+ # CircleCI has started automatically adding a read-only deploy key when following a project
139+ # This breaks our deployment process.
140+ # So we need to get a list of read-only keys, and delete them
141+ RO_KEYS=$( curl -sS --fail -u " ${USERNAME} :${PASSWORD} " -X GET \
142+ " https://api.github.com/repos/${EXCHANGE_ORG} /${REPO_NAME} /keys" | jq -r ' .[]| select(.read_only == true) | [.id]| @sh' )
143+
144+ for RO_KEY in ${RO_KEYS} ;
145+ do
146+ curl -sS --fail -u " ${USERNAME} :${PASSWORD} " -X DELETE " https://api.github.com/repos/${EXCHANGE_ORG} /${REPO_NAME} /keys/${RO_KEY} "
147+ done
148+
138149# Clean up
139150rm -rf " ${REPO_DIR} " " /tmp/${PACK} _rsa*" " /tmp/${PACK} _user_token"
You can’t perform that action at this time.
0 commit comments