diff --git a/.github/workflows/lighthouse-on-vercel-preview-url.yml b/.github/workflows/lighthouse-on-vercel-preview-url.yml index a893d0e1..c5822fdd 100644 --- a/.github/workflows/lighthouse-on-vercel-preview-url.yml +++ b/.github/workflows/lighthouse-on-vercel-preview-url.yml @@ -37,23 +37,21 @@ jobs: github-token: ${{secrets.GITHUB_TOKEN}} script: | const result = ${{ steps.lighthouse_audit.outputs.manifest }}[0].summary - const links = ${{ steps.lighthouse_audit.outputs.links }} + const link = ${{ steps.lighthouse_audit.outputs.manifest }}[0].url const formatResult = (res) => Math.round((res * 100)) Object.keys(result).forEach(key => result[key] = formatResult(result[key])) const score = res => res >= 90 ? '🟢' : res >= 50 ? '🟠' : '🔴' const comment = [ - `⚡️ [Lighthouse report](${Object.values(links)[0]}) for the changes in this commit:`, '', `${score(result.performance)} Performance: ${result.performance}`, `${score(result.accessibility)} Accessibility: ${result.accessibility}`, `${score(result['best-practices'])} Best practices: ${result['best-practices']}`, `${score(result.seo)} SEO: ${result.seo}`, ' ', - `*Lighthouse ran on [${Object.keys(links)[0]}](${Object.keys(links)[0]})*` - ].join('\n') + `*Lighthouse ran on ${link} core.setOutput("comment", comment); - name: Create commit comment uses: peter-evans/commit-comment@v3 with: body: | - "${{ steps.format_lighthouse_score.outputs.comment }}" + "${{ steps.format_lighthouse_score.outputs.comment }}" \ No newline at end of file