Skip to content

Commit b7b1e62

Browse files
committed
solve copilot comments
1 parent 4b95fce commit b7b1e62

6 files changed

Lines changed: 14 additions & 10 deletions

File tree

.github/actions/deploy-vercel-preview/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ runs:
3535
shell: bash
3636

3737
- name: Deploy to Vercel
38-
uses: amondnet/vercel-action@master
38+
uses: amondnet/vercel-action@v42.3.0
3939
id: vercel-deploy
4040
with:
4141
github-token: ${{ inputs.github-token }}

.github/workflows/deploy-fork-pr-preview.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ on:
33
workflow_dispatch:
44
inputs:
55
prNumber:
6-
description: 'Pull request number to deploy preview for (optional when auto-triggered by label)'
7-
required: false
6+
description: 'Pull request number to deploy preview for'
7+
required: true
88

99
permissions:
1010
contents: read
11-
pull-requests: read
11+
pull-requests: write
1212

1313
jobs:
1414
deploy:

.github/workflows/deploy-master.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
with:
2020
persist-credentials: false
2121

22-
- uses: amondnet/vercel-action@master
22+
- uses: amondnet/vercel-action@v42.3.0
2323
with:
2424
github-token: ${{ secrets.GITHUB_TOKEN }} # needed to allow comments on prs
2525
vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required

.github/workflows/label-trigger-deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
permissions:
88
actions: write
99
contents: read
10+
issues: write
1011
pull-requests: read
1112

1213
jobs:

.github/workflows/size-stats-comment.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ jobs:
1616
if: github.event.workflow_run.conclusion == 'success'
1717
steps:
1818
- name: Download size stats artifact
19-
uses: dawidd6/action-download-artifact@v3
19+
uses: actions/download-artifact@v4
2020
with:
21-
run_id: ${{ github.event.workflow_run.id }}
21+
github-token: ${{ secrets.GITHUB_TOKEN }}
22+
run-id: ${{ github.event.workflow_run.id }}
2223
name: size-stats-results
2324
path: size-stats-results
2425

@@ -30,12 +31,13 @@ jobs:
3031
3132
const marker = '<!-- size-stats-comment -->';
3233
const title = '**Size stats**';
33-
const prNumber = Number(fs.readFileSync('size-stats-results/pr_number.txt', 'utf8').trim());
34+
const workflowRunPrs = context.payload.workflow_run?.pull_requests || [];
35+
const prNumber = workflowRunPrs.length === 1 ? workflowRunPrs[0].number : NaN;
3436
const message = fs.readFileSync('size-stats-results/message.md', 'utf8').trim();
3537
const body = `${marker}\n${title}\n\n${message}`;
3638
3739
if (!Number.isInteger(prNumber) || prNumber <= 0) {
38-
core.setFailed('Invalid PR number in artifact payload');
40+
core.setFailed('Could not determine a unique PR number from workflow_run payload');
3941
return;
4042
}
4143

.github/workflows/size-stats.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ jobs:
6464
with:
6565
persist-credentials: false
6666

67+
- run: yarn install --immutable --immutable-cache
68+
6769
- name: Form size stats message
6870
id: message
6971
uses: './.github/actions/size-stats-message'
@@ -80,7 +82,6 @@ jobs:
8082
- name: Prepare artifact payload
8183
run: |
8284
mkdir -p size-stats-results
83-
echo "${{ github.event.pull_request.number }}" > size-stats-results/pr_number.txt
8485
cat > size-stats-results/message.md <<'EOF'
8586
${{ steps.message.outputs.message }}
8687
EOF

0 commit comments

Comments
 (0)