Skip to content

Commit 4b5ecdd

Browse files
Refactor analyze_comment.yml to ensure conditional execution based on download analysis outcome
1 parent 2bccc68 commit 4b5ecdd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/analyze_comment.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ permissions:
1010
contents: read
1111
issues: write
1212
pull-requests: write
13-
13+
1414
jobs:
1515
comment:
1616
runs-on: ubuntu-latest
@@ -20,6 +20,8 @@ jobs:
2020
steps:
2121
- name: Download base branch bundle stats
2222
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e
23+
continue-on-error: true
24+
id: download-analysis
2325
with:
2426
workflow: analyze.yml
2527
run_id: ${{ github.event.workflow_run.id }}
@@ -28,6 +30,7 @@ jobs:
2830

2931
- name: Download PR number
3032
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e
33+
if: steps.download-analysis.outcome == 'success'
3134
with:
3235
workflow: analyze.yml
3336
run_id: ${{ github.event.workflow_run.id }}
@@ -36,7 +39,7 @@ jobs:
3639

3740
- name: Get comment body
3841
id: get-comment-body
39-
if: success()
42+
if: steps.download-analysis.outcome == 'success'
4043
run: |
4144
echo 'body<<EOF' >> $GITHUB_OUTPUT
4245
echo '' >> $GITHUB_OUTPUT
@@ -54,6 +57,7 @@ jobs:
5457
5558
- name: Comment
5659
uses: marocchino/sticky-pull-request-comment@52423e01640425a022ef5fd42c6fb5f633a02728
60+
if: steps.download-analysis.outcome == 'success'
5761
with:
5862
header: next-bundle-analysis
5963
number: ${{ steps.get-comment-body.outputs.pr-number }}

0 commit comments

Comments
 (0)