File tree Expand file tree Collapse file tree
actions/deploy-vercel-preview Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 }}
Original file line number Diff line number Diff line change 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
99permissions :
1010 contents : read
11- pull-requests : read
11+ pull-requests : write
1212
1313jobs :
1414 deploy :
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 77permissions :
88 actions : write
99 contents : read
10+ issues : write
1011 pull-requests : read
1112
1213jobs :
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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'
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
You can’t perform that action at this time.
0 commit comments