From 3df46b240bdd019543d98f1697e614e887a3849e Mon Sep 17 00:00:00 2001 From: Bart van der Braak Date: Tue, 1 Aug 2023 00:28:44 +0200 Subject: [PATCH] feat: add cloudflare project and branch notation --- .github/workflows/unlighthouse-report.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unlighthouse-report.yaml b/.github/workflows/unlighthouse-report.yaml index c6871bc..788c796 100644 --- a/.github/workflows/unlighthouse-report.yaml +++ b/.github/workflows/unlighthouse-report.yaml @@ -11,6 +11,8 @@ jobs: env: COMMENT_ID: unlighthouse-node${{matrix.node-version}} PORT: 8000 + CLOUDFLARE_PROJECT: hellobart-unlighthouse + CLOUDFLARE_BRANCH: pull-${{ github.event.pull_request.number }} strategy: matrix: node-version: [18] @@ -62,7 +64,7 @@ jobs: uses: cloudflare/wrangler-action@2.0.0 with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} - command: pages publish .unlighthouse --branch=pull-${{ github.event.pull_request.number }} + command: pages deploy .unlighthouse --project-name="${{ env.CLOUDFLARE_PROJECT }}" --branch=${{ env.CLOUDFLARE_BRANCH }} - name: Create result content id: create_result_content @@ -79,7 +81,7 @@ jobs: const score = res => `${getEmoji(res)} ${formatScore(res)}`; - const reportUrl = ``; + const reportUrl = `https://${{ env.CLOUDFLARE_BRANCH }}.${{ env.CLOUDFLARE_PROJECT }}.pages.dev`; const comment = [ `⚡️ Lighthouse report for the changes in this PR:`,