Skip to content

Commit 78634ac

Browse files
committed
Workflow: Moved pull request query pagination to variables
1 parent 33fb1d7 commit 78634ac

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.github/workflows/lighthouse.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,15 @@ jobs:
2222
- name: Installing packages
2323
run: cd performance && npm ci
2424
- name: Get PR number being merged
25+
env:
26+
PAGE: 1
27+
PER_PAGE: 10
2528
run: |
2629
RESPONSE=$(curl -L \
2730
-X GET \
2831
-H "Accept: application/vnd.github+json" \
2932
-H "X-GitHub-Api-Version: 2022-11-28" \
30-
-s "https://api.github.com/repos/${{ env.OWNER }}/${{ env.REPO }}/pulls?state=closed&direction=desc&page=1&per_page=5")
33+
-s "https://api.github.com/repos/${{ env.OWNER }}/${{ env.REPO }}/pulls?state=closed&direction=desc&page=${{ env.PAGE }}&per_page=${{ env.PER_PAGE }}")
3134
LATEST_PR_NUMBER=$(echo "$RESPONSE" | jq -r '.[] | select(.merged_at != null) | .number' | head -1)
3235
echo "GITHUB_PR_NUMBER=$LATEST_PR_NUMBER" >> $GITHUB_ENV
3336
- name: Generating lighthouse reports for main...

0 commit comments

Comments
 (0)