Skip to content

Commit f5145ca

Browse files
committed
Lighthouse: DUmmy test
1 parent fb8b4f2 commit f5145ca

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/lighthouse.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Update lighthouse report artifact for main branch
2+
3+
on:
4+
push:
5+
branches:
6+
- "**"
7+
workflow_dispatch:
8+
9+
env:
10+
OWNER: nginx
11+
REPO: documentation
12+
jobs:
13+
generate-lighthouse-report:
14+
runs-on: ubuntu-22.04
15+
steps:
16+
- uses: actions/checkout@v5
17+
with:
18+
ref: ${{ github.event.workflow_run.head_branch }}
19+
- uses: actions/setup-node@v5
20+
with:
21+
node-version: 18
22+
- name: Installing packages
23+
run: cd performance && npm ci
24+
- name: Get PR number being merged
25+
run: |
26+
RESPONSE=$(curl -L \
27+
-X POST \
28+
-H "Accept: application/vnd.github+json" \
29+
-H "Authorization: Bearer ${{ secrets.DOCUMENTATION_SLACK_FLOW_PAT }}" \
30+
-H "X-GitHub-Api-Version: 2022-11-28" \
31+
-s "https://api.github.com/repos/${{ env.OWNER }}/${{ env.REPO }}/pulls?state=closed&direction=desc&page=1&per_page=5")
32+
LATEST_PR_NUMBER=$(echo "$RESPONSE" | jq -r '.[] | select(.merged_at != null) | .number' | head -1)
33+
echo "GITHUB_PR_NUMBER=$LATEST_PR_NUMBER" >> $GITHUB_ENV
34+
35+
- name: Generating lighthouse reports for main...
36+
run: |
37+
echo "${{ env.GITHUB_PR_NUMBER }}"
38+

0 commit comments

Comments
 (0)