@@ -174,33 +174,41 @@ jobs:
174174 - uses : dart-lang/setup-dart@65eb853c7ba17dde3be364c3d2858773e7144260
175175 - name : Install firehose (internal)
176176 if : github.repository == 'dart-lang/ecosystem'
177- run : dart pub global activate --source git https://github.com/dart-lang/ecosystem --git-path pkgs/firehose/ --git-ref ${{ github.head_ref || github.ref_name }}
177+ env :
178+ GIT_URL : ${{ github.event.pull_request.head.repo.clone_url || 'https://github.com/dart-lang/ecosystem' }}
179+ GIT_REF : ${{ github.head_ref || github.ref_name }}
180+ run : dart pub global activate --source git "$GIT_URL" --git-path pkgs/firehose/ --git-ref "$GIT_REF"
178181 - name : Install firehose (external)
179182 if : github.repository != 'dart-lang/ecosystem'
180183 run : dart pub global activate --source git https://github.com/dart-lang/ecosystem --git-path pkgs/firehose/
181184 - name : Find Comment
182185 id : fc
183186 env :
184187 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
188+ ISSUE_NUMBER : ${{ github.event.number }}
185189 run : |
186- COMMENT_ID=$(dart pub global run firehose:comment find --issue ${{ github.event.number }} --author github-actions[bot] --body-includes "## PR Health")
190+ COMMENT_ID=$(dart pub global run firehose:comment find --issue "$ISSUE_NUMBER" --author github-actions[bot] --body-includes "## PR Health")
187191 echo "comment-id=$COMMENT_ID" >> "$GITHUB_OUTPUT"
188192
189193 - name : Update comment
190194 uses : actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3
191195 if : steps.fc.outputs.comment-id != 0
196+ env :
197+ COMMENT_ID : ${{ steps.fc.outputs.comment-id }}
192198 with :
193199 github-token : ${{ secrets.GITHUB_TOKEN }}
194200 script : |
195201 await github.rest.issues.updateComment({
196202 owner: context.repo.owner,
197203 repo: context.repo.repo,
198- comment_id: ${{ steps.fc.outputs.comment-id }} ,
204+ comment_id: process.env.COMMENT_ID ,
199205 body: '## PR Health ⚠️\n\nHealth checks are rerunning. These details are out-of-date.'
200206 });
201207
202208 changelog :
203209 if : ${{ contains(inputs.checks, 'changelog') }}
210+ permissions :
211+ pull-requests : write
204212 uses : ./.github/workflows/health_base.yaml
205213 with :
206214 sdk : ${{ inputs.sdk }}
@@ -216,6 +224,8 @@ jobs:
216224
217225 license :
218226 if : ${{ contains(inputs.checks, 'license') }}
227+ permissions :
228+ pull-requests : write
219229 uses : ./.github/workflows/health_base.yaml
220230 with :
221231 sdk : ${{ inputs.sdk }}
@@ -233,6 +243,8 @@ jobs:
233243
234244 coverage :
235245 if : ${{ contains(inputs.checks, 'coverage') }}
246+ permissions :
247+ pull-requests : write
236248 uses : ./.github/workflows/health_base.yaml
237249 with :
238250 sdk : ${{ inputs.sdk }}
@@ -251,6 +263,8 @@ jobs:
251263
252264 breaking :
253265 if : ${{ contains(inputs.checks, 'breaking') }}
266+ permissions :
267+ pull-requests : write
254268 uses : ./.github/workflows/health_base.yaml
255269 with :
256270 sdk : ${{ inputs.sdk }}
@@ -266,6 +280,8 @@ jobs:
266280
267281 do-not-submit :
268282 if : ${{ contains(inputs.checks, 'do-not-submit') }}
283+ permissions :
284+ pull-requests : write
269285 uses : ./.github/workflows/health_base.yaml
270286 with :
271287 sdk : ${{ inputs.sdk }}
@@ -281,6 +297,8 @@ jobs:
281297
282298 leaking :
283299 if : ${{ contains(inputs.checks, 'leaking') }}
300+ permissions :
301+ pull-requests : write
284302 uses : ./.github/workflows/health_base.yaml
285303 with :
286304 sdk : ${{ inputs.sdk }}
@@ -296,6 +314,8 @@ jobs:
296314
297315 unused-dependencies :
298316 if : ${{ contains(inputs.checks, 'unused-dependencies') }}
317+ permissions :
318+ pull-requests : write
299319 uses : ./.github/workflows/health_base.yaml
300320 with :
301321 sdk : ${{ inputs.sdk }}
@@ -321,7 +341,10 @@ jobs:
321341 - uses : dart-lang/setup-dart@65eb853c7ba17dde3be364c3d2858773e7144260
322342 - name : Install firehose (internal)
323343 if : github.repository == 'dart-lang/ecosystem'
324- run : dart pub global activate --source git https://github.com/dart-lang/ecosystem --git-path pkgs/firehose/ --git-ref ${{ github.head_ref || github.ref_name }}
344+ env :
345+ GIT_URL : ${{ github.event.pull_request.head.repo.clone_url || 'https://github.com/dart-lang/ecosystem' }}
346+ GIT_REF : ${{ github.head_ref || github.ref_name }}
347+ run : dart pub global activate --source git "$GIT_URL" --git-path pkgs/firehose/ --git-ref "$GIT_REF"
325348 - name : Install firehose (external)
326349 if : github.repository != 'dart-lang/ecosystem'
327350 run : dart pub global activate --source git https://github.com/dart-lang/ecosystem --git-path pkgs/firehose/
@@ -336,16 +359,19 @@ jobs:
336359 id : fc
337360 env :
338361 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
362+ ISSUE_NUMBER : ${{ github.event.number }}
339363 run : |
340- COMMENT_ID=$(dart pub global run firehose:comment find --issue ${{ github.event.number }} --author github-actions[bot] --body-includes "## PR Health")
364+ COMMENT_ID=$(dart pub global run firehose:comment find --issue "$ISSUE_NUMBER" --author github-actions[bot] --body-includes "## PR Health")
341365 echo "comment-id=$COMMENT_ID" >> "$GITHUB_OUTPUT"
342366
343367 - name : Merge all single comments
368+ env :
369+ ISSUE_NUMBER : ${{ github.event.number }}
344370 run : |
345371 mkdir output
346372 echo $'## PR Health\n\n' >> output/comment.md
347373 find single-comments -name '*.md' -exec cat {} + >> output/comment.md
348- echo ${{ github.event.number }} > output/issueNumber
374+ echo "$ISSUE_NUMBER" > output/issueNumber
349375
350376 - name : Write comment id to file
351377 if : ${{ steps.fc.outputs.comment-id != 0 }}
0 commit comments