From a0ae706fab2b30656f702426bd5beecaa09eeeff Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Wed, 11 Jan 2023 10:58:25 -0800 Subject: [PATCH] Remove PAT_TOKEN and PAT_USERNAME from CircleCI (#35808) Summary: This is a cleanup change needed after the CircleCI security incident. We should be using the `Authorization: Bearer` header to trigger `rn-diff-purge` instead of using username & password authentication. Source: https://docs.github.com/rest/reference/repos#create-a-repository-dispatch-event ## Changelog [INTERNAL] - Remove PAT_TOKEN and PAT_USERNAME from CircleCI Pull Request resolved: https://github.com/facebook/react-native/pull/35808 Test Plan: I've tested this locally with: ``` curl -X POST https://api.github.com/repos/react-native-community/rn-diff-purge/dispatches \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: Bearer [...]" \ -d "{\"event_type\": \"publish\", \"client_payload\": { \"version\": \"test.test.test\" }}" ``` and the run was succesfully fired by react-native-bot: https://github.com/react-native-community/rn-diff-purge/actions/runs/3894079133 Reviewed By: lunaleaps Differential Revision: D42456065 Pulled By: cortinico fbshipit-source-id: 475e9ca80760522cc08bad37d85c5af6727922d3 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4a61f7b8e64..3b6ba84c411 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -816,7 +816,7 @@ jobs: command: | curl -X POST https://api.github.com/repos/react-native-community/rn-diff-purge/dispatches \ -H "Accept: application/vnd.github.v3+json" \ - -u "$PAT_USERNAME:$PAT_TOKEN" \ + -H "Authorization: Bearer $REACT_NATIVE_BOT_GITHUB_TOKEN" \ -d "{\"event_type\": \"publish\", \"client_payload\": { \"version\": \"${CIRCLE_TAG:1}\" }}" # -------------------------