88 - labeled
99 - synchronize
1010
11+ permissions :
12+ pull-requests : write
13+ issues : write
14+
1115jobs :
1216 deploy-en :
1317 if : contains(github.event.pull_request.labels.*.name, 'prerelease')
2024 VERCEL_ORG_ID : ${{ secrets.VERCEL_ORG_ID }}
2125 VERCEL_TOKEN : ${{ secrets.VERCEL_TOKEN }}
2226
27+ comment-vercel-preview-en :
28+ if : contains(github.event.pull_request.labels.*.name, 'prerelease')
29+ needs : deploy-en
30+ runs-on : ubuntu-latest
31+ steps :
32+ - name : Checkout repo for local action
33+ uses : actions/checkout@v4
34+ - name : Comment PR with Vercel Preview Links (EN)
35+ uses : ./.github/actions/comment-vercel-preview
36+ with :
37+ inspect_url : ${{ needs.deploy-en.outputs.inspect_url }}
38+ preview_url : ${{ needs.deploy-en.outputs.prod_url }}
39+ label : EN
40+
2341 deploy-zh-hans :
2442 if : contains(github.event.pull_request.labels.*.name, 'prerelease')
2543 uses : ./.github/workflows/vercel-deploy.yml
@@ -31,30 +49,16 @@ jobs:
3149 VERCEL_ORG_ID : ${{ secrets.VERCEL_ORG_ID }}
3250 VERCEL_TOKEN : ${{ secrets.VERCEL_TOKEN }}
3351
34- comment-vercel-preview :
52+ comment-vercel-preview-zh-hans :
3553 if : contains(github.event.pull_request.labels.*.name, 'prerelease')
36- needs : [ deploy-en, deploy- zh-hans]
54+ needs : deploy-zh-hans
3755 runs-on : ubuntu-latest
3856 steps :
39- - name : Comment PR with Vercel Preview Links
40- uses : actions/github-script@v7
57+ - name : Checkout repo for local action
58+ uses : actions/checkout@v4
59+ - name : Comment PR with Vercel Preview Links (ZH-HANS)
60+ uses : ./.github/actions/comment-vercel-preview
4161 with :
42- script : |
43- const en_inspect = process.env.EN_INSPECT_URL;
44- const en_prod = process.env.EN_PROD_URL;
45- const zh_inspect = process.env.ZH_INSPECT_URL;
46- const zh_prod = process.env.ZH_PROD_URL;
47- let body = `**Vercel Deploy Preview**\n\n`;
48- body += `- 🇺🇸 EN: [Inspect](${en_inspect}) | [Preview](${en_prod})\n`;
49- body += `- 🇨🇳 ZH-HANS: [Inspect](${zh_inspect}) | [Preview](${zh_prod})`;
50- github.rest.issues.createComment({
51- issue_number: context.issue.number,
52- owner: context.repo.owner,
53- repo: context.repo.repo,
54- body
55- });
56- env :
57- EN_INSPECT_URL : ${{ needs.deploy-en.outputs.inspect_url }}
58- EN_PROD_URL : ${{ needs.deploy-en.outputs.prod_url }}
59- ZH_INSPECT_URL : ${{ needs.deploy-zh-hans.outputs.inspect_url }}
60- ZH_PROD_URL : ${{ needs.deploy-zh-hans.outputs.prod_url }}
62+ inspect_url : ${{ needs.deploy-zh-hans.outputs.inspect_url }}
63+ preview_url : ${{ needs.deploy-zh-hans.outputs.prod_url }}
64+ label : ZH-HANS
0 commit comments