8
8
- labeled
9
9
- synchronize
10
10
11
+ permissions :
12
+ pull-requests : write
13
+ issues : write
14
+
11
15
jobs :
12
- deploy-en :
13
- if : contains(github.event.pull_request.labels.*.name, 'prerelease')
14
- uses : ./.github/workflows/vercel-deploy.yml
15
- with :
16
- environment : preview
17
- prodFlag : ' '
18
- secrets :
19
- VERCEL_PROJECT_ID : ${{ secrets.VERCEL_PROJECT_EN_ID }}
20
- VERCEL_ORG_ID : ${{ secrets.VERCEL_ORG_ID }}
21
- VERCEL_TOKEN : ${{ secrets.VERCEL_TOKEN }}
16
+ # deploy-en:
17
+ # if: contains(github.event.pull_request.labels.*.name, 'prerelease')
18
+ # uses: ./.github/workflows/vercel-deploy.yml
19
+ # with:
20
+ # environment: preview
21
+ # prodFlag: ''
22
+ # secrets:
23
+ # VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_EN_ID }}
24
+ # VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
25
+ # VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
26
+
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
22
40
23
41
deploy-zh-hans :
24
42
if : contains(github.event.pull_request.labels.*.name, 'prerelease')
@@ -31,30 +49,17 @@ jobs:
31
49
VERCEL_ORG_ID : ${{ secrets.VERCEL_ORG_ID }}
32
50
VERCEL_TOKEN : ${{ secrets.VERCEL_TOKEN }}
33
51
34
- comment-vercel-preview :
52
+ comment-vercel-preview-zh-hans :
35
53
if : contains(github.event.pull_request.labels.*.name, 'prerelease')
36
- needs : [ deploy-en, deploy- zh-hans]
54
+ needs : deploy-zh-hans
37
55
runs-on : ubuntu-latest
38
56
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
+ - run : echo '${{ toJSON(needs.deploy-zh-hans.outputs) }}'
60
+ - name : Comment PR with Vercel Preview Links (ZH-HANS)
61
+ uses : ./.github/actions/comment-vercel-preview
41
62
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 }}
63
+ inspect_url : ${{ needs.deploy-zh-hans.outputs.inspect_url }}
64
+ preview_url : ${{ needs.deploy-zh-hans.outputs.prod_url }}
65
+ label : ZH-HANS
0 commit comments