From 6497a757834e2814e2e39c2dfbb56c3c875f7984 Mon Sep 17 00:00:00 2001 From: Jenna Goldstrich Date: Thu, 26 May 2022 12:19:38 -0700 Subject: [PATCH] Revert "Remove Access Token Check, Silence curl request, and Merge Clone & Test steps in HPATS" --- .github/workflows/acceptance-test.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/acceptance-test.yml b/.github/workflows/acceptance-test.yml index 56cd58f1f..d8ccb18a0 100644 --- a/.github/workflows/acceptance-test.yml +++ b/.github/workflows/acceptance-test.yml @@ -75,15 +75,17 @@ jobs: - uses: actions/setup-go@v2 with: go-version: ${{ needs.get-go-version.outputs.go-version }} - - name: Set HCP Access Token - run: | - export HCP_ACCESS_TOKEN=$(curl --silent --request POST --header "Content-Type: application/json" --data '{"audience": "https://api.hashicorp.cloud","grant_type": "client_credentials","client_id": "'"$AUTH0_CLIENT_ID"'","client_secret": "'"$AUTH0_CLIENT_SECRET"'"}' "${AUTH0_HOST}/oauth/token" | jq '.access_token' --raw-output) - - name: Clone & Run HPATS + - name: Clone HPATS run: | eval `ssh-agent -s` && ssh-add - <<< '${{ secrets.HPATS_ACCESS_TOKEN }}' git clone git@github.com:hashicorp/hcp-packer-acceptance-tests cd hcp-packer-acceptance-tests - make test + - name: Set HCP Access Token + run: | + export HCP_ACCESS_TOKEN=$(curl --request POST --header "Content-Type: application/json" --data '{"audience": "https://api.hashicorp.cloud","grant_type": "client_credentials","client_id": "'"$AUTH0_CLIENT_ID"'","client_secret": "'"$AUTH0_CLIENT_SECRET"'"}' "${AUTH0_HOST}/oauth/token" | jq '.access_token' --raw-output) + if [ -z $HCP_ACCESS_TOKEN ]; then; echo "HCP_ACCESS_TOKEN was not set" && exit 1; else echo "HCP_ACCESS_TOKEN set"; fi; + - name: Run HPATS + run: make test # Send a slack notification if one of the jobs defined above fails slack-notify: needs: