diff --git a/.github/workflows/create_preview_sites.yml b/.github/workflows/create_preview_sites.yml index 40dd37731cba09..dc938eba0f838f 100644 --- a/.github/workflows/create_preview_sites.yml +++ b/.github/workflows/create_preview_sites.yml @@ -52,8 +52,9 @@ jobs: run: | unzip pr.zip -d pr BRANCH_NAME=$(cat ./pr/branch) - SANITIZED_BRANCH_NAME=$(echo "$BRANCH_NAME" | sed 's/\./-/g') + SANITIZED_BRANCH_NAME=$(echo "$BRANCH_NAME" | sed 's/[\/\.]/-/g') echo "SANITIZED_BRANCH_NAME=$SANITIZED_BRANCH_NAME" >> $GITHUB_ENV + echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV # Kick off the job in amplify - name: Deploy Site @@ -64,12 +65,13 @@ jobs: REQUEST_MESSAGE: ${{ secrets.REQUEST_MESSAGE }} ENDPOINT: ${{ secrets.ENDPOINT }} run: | + sleep 20 HMAC_KEY=$(echo -n $REQUEST_MESSAGE | openssl dgst -sha256 -hmac "$REQUEST_TOKEN" -binary | od -An -tx1 | tr -d ' \n'; echo) SIGNATURE="sha256=$HMAC_KEY" RESPONSE_CODE=$(curl -s -o /dev/null -w "%{http_code}" -X POST \ -H "Content-Type: application/json" \ -H "X-Hub-Signature: $SIGNATURE" \ - -d "{\"app_id\": \"$APP_ID\", \"branch_name\": \"$SANITIZED_BRANCH_NAME\"}" \ + -d "{\"app_id\": \"$APP_ID\", \"branch_name\": \"$BRANCH_NAME\"}" \ "$ENDPOINT") # check the response code and fail if not 200 @@ -91,6 +93,7 @@ jobs: const fs = require('fs'); const prNumber = fs.readFileSync('./pr/number', 'utf8'); const issueNumber = parseInt(prNumber); + const { APP_ID, APP_NAME, SANITIZED_BRANCH_NAME } = process.env await github.rest.issues.createComment({ owner: context.repo.owner,