Skip to content

Commit

Permalink
ci: add lighthouse report (#13)
Browse files Browse the repository at this point in the history
* ci: add lighthouse report comment
* ci: fix expression injection attack
  • Loading branch information
grantwforsythe authored May 7, 2024
1 parent ddabe23 commit b247ab3
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
on: issue_comment

jobs:
lighthouse:
runs-on: ubuntu-latest
if: >-
github.event.issue.pull_request &&
github.event.comment.user.login == 'render[bot]'
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Get preview URL
id: preview-url
env:
BODY: ${{ github.event.comment.body }}
run: |
PREVIEW_URL=$(echo "$BODY" | grep -o 'https:\/\/.*\.onrender\.com' | head -n 1)
echo "PREVIEW_URL=$PREVIEW_URL" >> $GITHUB_ENV
- name: Lighthouse Report
uses: foo-software/lighthouse-check-action@master
with:
urls: '${{ env.PREVIEW_URL }}'
prCommentEnabled: true
gitHubAcessToken: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit b247ab3

Please sign in to comment.