1515 contents : read # to clone the repo
1616 steps :
1717 - name : Check User Permissions
18- uses : actions/github-script@v7
18+ uses : actions/github-script@v8
1919 id : check-permissions
2020 with :
2121 script : |
5656 }
5757
5858 - name : Get PR Data
59- uses : actions/github-script@v7
59+ uses : actions/github-script@v8
6060 id : get-pr-data
6161 with :
6262 script : |
7575 }
7676
7777 - name : Check Package Existence
78- uses : actions/github-script@v7
78+ uses : actions/github-script@v8
7979 id : check-package
8080 with :
8181 script : |
@@ -109,12 +109,14 @@ jobs:
109109
110110 - name : Trigger Preview Release (if Package Not Found)
111111 if : fromJSON(steps.check-package.outputs.result).exists == false
112- uses : actions/github-script@v7
112+ 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
@@ -128,12 +130,15 @@ jobs:
128130
129131 - name : Wait for Preview Release Completion (if Package Not Found)
130132 if : fromJSON(steps.check-package.outputs.result).exists == false
131- uses : actions/github-script@v7
133+ 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,
@@ -195,34 +200,22 @@ jobs:
195200 }
196201
197202 - name : Checkout
198- uses : actions/checkout@v4
203+ uses : actions/checkout@v5
199204 with :
200205 ref : refs/pull/${{ fromJSON(steps.get-pr-data.outputs.result).num }}/head
201206 fetch-depth : 0
202207
203- # This step can be removed on May 26 2025
204- - name : Check Commit Hash Ambiguity
205- id : check_ambiguity
206- run : |
207- HEAD_SHA=${{ steps.get-pr-data.outputs.head_sha }}
208- COMMIT_SHORT=${HEAD_SHA:0:7}
209-
210- if git show "$COMMIT_SHORT"; then
211- echo "COLLISION=false" >> $GITHUB_ENV
212- else
213- echo "COLLISION=true" >> $GITHUB_ENV
214- fi
215-
216208 - name : Trigger Downstream Workflow
217- uses : actions/github-script@v7
209+ uses : actions/github-script@v8
218210 id : trigger
219211 env :
220212 COMMENT : ${{ github.event.comment.body }}
213+ PR_DATA : ${{ steps.get-pr-data.outputs.result }}
221214 with :
222215 github-token : ${{ steps.generate-token.outputs.token }}
223216 script : |
224217 const comment = process.env.COMMENT.trim()
225- const prData = ${{ steps.get-pr-data.outputs.result }}
218+ const prData = JSON.parse(process.env.PR_DATA)
226219
227220 const suite = comment.split('\n')[0].replace(/^\/ecosystem-ci run/, '').trim()
228221
0 commit comments