Skip to content

Commit 9f5c18b

Browse files
committed
Add comment to a PR to inform when visualization report failed
1 parent fac907a commit 9f5c18b

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

.github/workflows/deploy-dbt.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ jobs:
476476

477477
- name: Download latest artifacts from production dbt docs
478478
working-directory: warehouse
479-
run: gsutil cp gs://calitp-dbt-docs/*.json ./target/latest/
479+
run: gsutil cp gs://calitp-dbt-artifacts/latest/*.json ./target/latest/
480480

481481
- name: Setup Continuous Machine Learning tools
482482
uses: iterative/setup-cml@v2
@@ -496,7 +496,24 @@ jobs:
496496
warehouse/target/dag.png
497497
498498
- name: Create GitHub comment
499+
id: report-comment
499500
working-directory: warehouse
501+
continue-on-error: true
500502
env:
501503
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
502-
run: cml comment update target/report.md || echo "Failed to generate GitHub comment"
504+
run: cml comment update target/report.md
505+
506+
- uses: peter-evans/find-comment@v3
507+
if: ${{ steps.report-comment.outcome == 'failure' }}
508+
id: fc
509+
with:
510+
issue-number: ${{ github.event.number }}
511+
body-includes: "Failed to add ci-report to a comment"
512+
513+
- uses: peter-evans/create-or-update-comment@v4
514+
if: ${{ steps.report-comment.outcome == 'failure' }}
515+
with:
516+
comment-id: ${{ steps.fc.outputs.comment-id }}
517+
issue-number: ${{ github.event.number }}
518+
body: "Failed to add ci-report to a comment. You can download the ci-report in the [Summary](https://github.com/cal-itp/data-infra/actions/runs/${{ github.run_id }})."
519+
edit-mode: replace

0 commit comments

Comments
 (0)