Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(website): Fix commenting step on workflow #19134

Merged
merged 3 commits into from
Nov 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/create_preview_sites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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,
Expand Down
Loading