Skip to content

chore(deps): bump the npm_and_yarn group across 2 directories with 7 updates #332

chore(deps): bump the npm_and_yarn group across 2 directories with 7 updates

chore(deps): bump the npm_and_yarn group across 2 directories with 7 updates #332

Workflow file for this run

name: Web App - PR Preview
on:
pull_request:
branches:
- main
paths:
- "web-app/**"
- "functions/**"
- ".github/workflows/web-*.yml"
jobs:
deploy-web-app:
name: Deploy Web App
uses: ./.github/workflows/web-app-deployer.yml
with:
FIREBASE_PROJECT: dev
PREVIEW_DEPLOYMENT: true
FEED_SUBMIT_GOOGLE_SHEET_ID: "1iXwux9hM4p5Li1EGgwx-8hU3sMDnF15yTflqmGjiZqE"
PREVIEW_HOST_NAME: "pr-${{ github.event.number }}"
secrets: inherit
update-pr-comment:
name: Update PR comments
runs-on: ubuntu-latest
needs: [ deploy-web-app ]
env:
PR_ID: ${{ github.event.number }}
steps:
- name: Check for Existing Comment
id: check-comment
run: |
HOSTING_URL=$(echo "$HOSTING_URL_64" | base64 -d)
COMMENT="Preview Firebase Hosting URL: $HOSTING_URL"
echo "PR comment: $COMMENT"
COMMENTS=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/${{ github.repository }}/issues/${{ env.PR_ID }}/comments")
JQ_CHECK=`echo "$COMMENTS" | jq -r ".[] | select(.body == \"$COMMENT\")"`
if [ -z "$JQ_CHECK" ]; then
echo "Comment does not exist."
echo "comment_exists=false" >> $GITHUB_OUTPUT
else
echo "Comment already exists."
echo "comment_exists=true" >> $GITHUB_OUTPUT
fi
env:
HOSTING_URL_64: ${{ needs.deploy-web-app.outputs.hosting_url }}
- name: Comment on PR with Hosting URL (PR Preview)
if: steps.check-comment.outputs.comment_exists == 'false'
run: |
HOSTING_URL=$(echo "$HOSTING_URL_64" | base64 -d)
COMMENT="Preview Firebase Hosting URL: $HOSTING_URL"
echo "$COMMENT" > comment.txt
curl -d "{\"body\":\"$(cat comment.txt)\"}" -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Content-Type: application/json" -X POST "https://api.github.com/repos/${{ github.repository }}/issues/${{ env.PR_ID }}/comments"
env:
HOSTING_URL_64: ${{ needs.deploy-web-app.outputs.hosting_url }}