Skip to content

Commit

Permalink
Switch to PAT generated GH token (#1942)
Browse files Browse the repository at this point in the history
* Update pre-command

* Update pre-command
  • Loading branch information
ev1yehor authored Jul 29, 2024
1 parent eab5375 commit ee8bd34
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions .buildkite/hooks/pre-command
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export WORKSPACE


AWS_SERVICE_ACCOUNT_SECRET_PATH=kv/ci-shared/platform-ingest/aws_ingest_ci
GITHUB_TOKEN_VAULT_PATH=kv/ci-shared/platform-ingest/github_token
PRIVATE_CI_GCS_CREDENTIALS_PATH=kv/ci-shared/platform-ingest/gcp-platform-ingest-ci-service-account

EC_TOKEN_PATH=kv/ci-shared/platform-ingest/platform-ingest-ec-qa
Expand Down Expand Up @@ -106,17 +105,15 @@ if is_step_testing_aws; then
fi

if [[ "$BUILDKITE_PIPELINE_SLUG" == "elastic-package" && "$BUILDKITE_STEP_KEY" == "release" ]]; then
GITHUB_TOKEN=$(retry 5 vault kv get -field token ${GITHUB_TOKEN_VAULT_PATH})
GITHUB_TOKEN=$VAULT_GITHUB_TOKEN
export GITHUB_TOKEN
fi

if [[ "$BUILDKITE_PIPELINE_SLUG" == "elastic-package-test-with-integrations" && "$BUILDKITE_STEP_KEY" == "pr-integrations" ]]; then
GITHUB_USERNAME_SECRET=$(retry 5 vault kv get -field username ${GITHUB_TOKEN_VAULT_PATH})
export GITHUB_USERNAME_SECRET
GITHUB_EMAIL_SECRET=$(retry 5 vault kv get -field email ${GITHUB_TOKEN_VAULT_PATH})
export GITHUB_EMAIL_SECRET
GITHUB_TOKEN=$(retry 5 vault kv get -field token ${GITHUB_TOKEN_VAULT_PATH})
export GITHUB_TOKEN
GITHUB_USERNAME_SECRET="elasticmachine"
export GITHUB_USERNAME_SECRET=$GITHUB_USERNAME_SECRET
export GITHUB_EMAIL_SECRET="[email protected]"
export GITHUB_TOKEN=$VAULT_GITHUB_TOKEN
fi

if [[ "$BUILDKITE_PIPELINE_SLUG" == "elastic-package-cloud-cleanup" && "$BUILDKITE_STEP_KEY" == "cloud-cleanup" ]]; then
Expand All @@ -138,7 +135,7 @@ if [[ "${BUILDKITE_PIPELINE_SLUG}" == "elastic-package-test-serverless" ]]; then
EC_REGION_SECRET=$(retry 5 vault read -field region_qa "${EC_DATA_PATH}")
export EC_REGION_SECRET

GITHUB_TOKEN=$(retry 5 vault kv get -field token ${GITHUB_TOKEN_VAULT_PATH})
GITHUB_TOKEN=$VAULT_GITHUB_TOKEN
export GITHUB_TOKEN
fi
fi

0 comments on commit ee8bd34

Please sign in to comment.