Skip to content

Commit fe68ab3

Browse files
authored
ci: avoid interpolation (#20794)
1 parent 6901fdb commit fe68ab3

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

.github/workflows/ecosystem-ci-trigger.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,12 @@ jobs:
111111
if: fromJSON(steps.check-package.outputs.result).exists == false
112112
uses: actions/github-script@v8
113113
id: trigger-preview-release
114+
env:
115+
PR_DATA: ${{ steps.get-pr-data.outputs.result }}
114116
with:
115117
github-token: ${{ steps.generate-token.outputs.token }}
116118
script: |
117-
const prData = ${{ steps.get-pr-data.outputs.result }}
119+
const prData = JSON.parse(process.env.PR_DATA)
118120
console.log('Package not found, triggering preview release...')
119121
120122
// Add label "trigger: preview" to the PR
@@ -130,10 +132,13 @@ jobs:
130132
if: fromJSON(steps.check-package.outputs.result).exists == false
131133
uses: actions/github-script@v8
132134
id: wait-preview-release
135+
env:
136+
PR_DATA: ${{ steps.get-pr-data.outputs.result }}
137+
REACTION: ${{ fromJSON(steps.check-package.outputs.result).reaction }}
133138
with:
134139
script: |
135-
const prData = ${{ steps.get-pr-data.outputs.result }}
136-
const reaction = ${{ fromJSON(steps.check-package.outputs.result).reaction }}
140+
const prData = JSON.parse(process.env.PR_DATA)
141+
const reaction = +process.env.REACTION
137142
const workflowFileName = 'preview-release.yml'
138143
const workflow = await github.rest.actions.getWorkflow({
139144
owner: context.repo.owner,
@@ -205,11 +210,12 @@ jobs:
205210
id: trigger
206211
env:
207212
COMMENT: ${{ github.event.comment.body }}
213+
PR_DATA: ${{ steps.get-pr-data.outputs.result }}
208214
with:
209215
github-token: ${{ steps.generate-token.outputs.token }}
210216
script: |
211217
const comment = process.env.COMMENT.trim()
212-
const prData = ${{ steps.get-pr-data.outputs.result }}
218+
const prData = JSON.parse(process.env.PR_DATA)
213219
214220
const suite = comment.split('\n')[0].replace(/^\/ecosystem-ci run/, '').trim()
215221

.github/workflows/publish.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,6 @@ jobs:
3636
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1"
3737

3838
- name: Publish package
39-
run: npm i -g npm@^11.5.2 && pnpm run ci-publish ${{ github.ref_name }}
39+
run: npm i -g npm@^11.5.2 && pnpm run ci-publish "$REF_NAME"
40+
env:
41+
REF_NAME: ${{ github.ref_name }}

0 commit comments

Comments
 (0)