From 599db968e575d8f7adc55d9bb533d7a50466c7c6 Mon Sep 17 00:00:00 2001 From: Jenna Goldstrich Date: Thu, 26 May 2022 11:29:59 -0700 Subject: [PATCH 1/2] Remove Access Token Check, and silence curl request --- .github/workflows/acceptance-test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/acceptance-test.yml b/.github/workflows/acceptance-test.yml index d8ccb18a0..8a9fa0830 100644 --- a/.github/workflows/acceptance-test.yml +++ b/.github/workflows/acceptance-test.yml @@ -82,8 +82,7 @@ jobs: cd hcp-packer-acceptance-tests - 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; + 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: Run HPATS run: make test # Send a slack notification if one of the jobs defined above fails From 394c5e11754fb9cd877a0fbc8f684dd12bb61392 Mon Sep 17 00:00:00 2001 From: Jenna Goldstrich Date: Thu, 26 May 2022 11:39:04 -0700 Subject: [PATCH 2/2] Merge Clone and run steps cause it doesn't look like CDing into hpats directory works --- .github/workflows/acceptance-test.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/acceptance-test.yml b/.github/workflows/acceptance-test.yml index 8a9fa0830..56cd58f1f 100644 --- a/.github/workflows/acceptance-test.yml +++ b/.github/workflows/acceptance-test.yml @@ -75,16 +75,15 @@ jobs: - uses: actions/setup-go@v2 with: go-version: ${{ needs.get-go-version.outputs.go-version }} - - name: Clone HPATS + - 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 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 - - 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: Run HPATS - run: make test + make test # Send a slack notification if one of the jobs defined above fails slack-notify: needs: