@@ -23,57 +23,43 @@ defaults:
2323permissions :
2424 contents : read
2525 actions : read
26- # This permission is required by `thollander/actions-comment-pull-request`
27- pull-requests : write
26+
27+ concurrency :
28+ group : ${{ github.workflow }}-${{ github.event.pull_request.number }}
29+ cancel-in-progress : true
2830
2931jobs :
30- get-vercel-preview :
32+ lighthouse-ci :
3133 # We want to skip our lighthouse analysis on Dependabot PRs
3234 if : |
3335 startsWith(github.event.pull_request.head.ref, 'dependabot/') == false &&
3436 github.event.label.name == 'github_actions:pull-request'
35- name : Get Vercel Preview
36- runs-on : ubuntu-latest
37- outputs :
38- deployment_found : ${{ steps.set_outputs.outputs.deployment_found }}
39- url : ${{ steps.set_outputs.outputs.url }}
40- steps :
41- - name : Capture Vercel Preview
42- id : check_deployment
43- uses : patrickedqvist/wait-for-vercel-preview@d7982701e6fcd3ae073bff929e408e004404d38d # v1.3.3
44- with :
45- token : ${{ secrets.GITHUB_TOKEN }}
46- max_timeout : 300 # timeout after 5 minutes
47- check_interval : 10 # check every 10 seconds
48- continue-on-error : true
49- - name : Set Outputs
50- if : always()
51- id : set_outputs
52- run : |
53- if [[ -z "${{ steps.check_deployment.outputs.url }}" ]]; then
54- echo "deployment_found=false" >> $GITHUB_OUTPUT
55- else
56- echo "deployment_found=true" >> $GITHUB_OUTPUT
57- echo "url=${{ steps.check_deployment.outputs.url }}" >> $GITHUB_OUTPUT
58- fi
59-
60- lighthouse-ci :
61- needs : get-vercel-preview
62- if : needs.get-vercel-preview.outputs.deployment_found == 'true'
6337 name : Lighthouse Report
6438 runs-on : ubuntu-latest
39+ permissions :
40+ # Required by `thollander/actions-comment-pull-request`
41+ pull-requests : write
6542
6643 steps :
6744 - name : Harden Runner
6845 uses : step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
6946 with :
7047 egress-policy : audit
7148
49+ - name : Capture Vercel Preview
50+ id : deployment
51+ uses : patrickedqvist/wait-for-vercel-preview@d7982701e6fcd3ae073bff929e408e004404d38d # v1.3.3
52+ with :
53+ token : ${{ secrets.GITHUB_TOKEN }}
54+ max_timeout : 300 # timeout after 5 minutes
55+ check_interval : 10 # check every 10 seconds
56+
7257 - name : Git Checkout
7358 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
7459 with :
7560 # Provides the Pull Request commit SHA or the GitHub merge group ref
7661 ref : ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.ref }}
62+ persist-credentials : false
7763
7864 - name : Add Comment to PR
7965 # Signal that a lighthouse run is about to start
@@ -93,12 +79,12 @@ jobs:
9379 configPath : ' ./.lighthouserc.json'
9480 # These URLS capture critical pages / site functionality.
9581 urls : |
96- ${{ needs.get-vercel-preview .outputs.url }}/en
97- ${{ needs.get-vercel-preview .outputs.url }}/en/about
98- ${{ needs.get-vercel-preview .outputs.url }}/en/about/previous-releases
99- ${{ needs.get-vercel-preview .outputs.url }}/en/download
100- ${{ needs.get-vercel-preview .outputs.url }}/en/download/archive/current
101- ${{ needs.get-vercel-preview .outputs.url }}/en/blog
82+ ${{ steps.deployment .outputs.url }}/en
83+ ${{ steps.deployment .outputs.url }}/en/about
84+ ${{ steps.deployment .outputs.url }}/en/about/previous-releases
85+ ${{ steps.deployment .outputs.url }}/en/download
86+ ${{ steps.deployment .outputs.url }}/en/download/archive/current
87+ ${{ steps.deployment .outputs.url }}/en/blog
10288 uploadArtifacts : true # save results as a action artifacts
10389 temporaryPublicStorage : true # upload lighthouse report to the temporary storage
10490
11197 # see https://github.com/actions/github-script#use-env-as-input
11298 LIGHTHOUSE_RESULT : ${{ steps.lighthouse_audit.outputs.manifest }}
11399 LIGHTHOUSE_LINKS : ${{ steps.lighthouse_audit.outputs.links }}
114- VERCEL_PREVIEW_URL : ${{ needs.get-vercel-preview .outputs.url }}
100+ VERCEL_PREVIEW_URL : ${{ steps.deployment .outputs.url }}
115101 with :
116102 # Run as a separate file so we do not have to inline all of our formatting logic.
117103 # See https://github.com/actions/github-script#run-a-separate-file for more info.
0 commit comments