Skip to content

Lighthouse: DUmmy test #3

Lighthouse: DUmmy test

Lighthouse: DUmmy test #3

Workflow file for this run

name: Update lighthouse report artifact for main branch
on:
push:
branches:
- "**"
workflow_dispatch:
env:
OWNER: nginx
REPO: documentation
jobs:
generate-lighthouse-report:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v5
with:
ref: ${{ github.event.workflow_run.head_branch }}
- uses: actions/setup-node@v5
with:
node-version: 18
- name: Installing packages
run: cd performance && npm ci
- name: Get PR number being merged
run: |
RESPONSE=$(curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.DOCUMENTATION_SLACK_FLOW_PAT }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-s "https://api.github.com/repos/${{ env.OWNER }}/${{ env.REPO }}/pulls?state=closed&direction=desc&page=1&per_page=5")
LATEST_PR_NUMBER=$(echo "$RESPONSE" | jq -r '.[] | select(.merged_at != null) | .number' | head -1)
echo "GITHUB_PR_NUMBER=$LATEST_PR_NUMBER" >> $GITHUB_ENV
- name: Generating lighthouse reports for main...
run: |
echo "${{ env.GITHUB_PR_NUMBER }}"