Skip to content

Commit 0a6cbcf

Browse files
committed
Add comment to a PR to inform when visualization report failed
1 parent 8daeb1c commit 0a6cbcf

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

.github/workflows/deploy-dbt.yml

Lines changed: 18 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
@@ -497,6 +497,22 @@ jobs:
497497
498498
- name: Create GitHub comment
499499
working-directory: warehouse
500+
continue-on-error: true
500501
env:
501502
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
502-
run: cml comment update target/report.md || echo "Failed to generate GitHub comment"
503+
run: cml comment update target/report.md
504+
505+
- uses: peter-evans/find-comment@v3
506+
if: ${{ failure() }}
507+
id: fc
508+
with:
509+
issue-number: ${{ github.event.number }}
510+
body-includes: "Failed to add ci-report to a comment"
511+
512+
- uses: peter-evans/create-or-update-comment@v4
513+
if: ${{ failure() }}
514+
with:
515+
comment-id: ${{ steps.fc.outputs.comment-id }}
516+
issue-number: ${{ github.event.number }}
517+
body: "Failed to add ci-report to a comment. You can visualize the ci-report artifact in the [Summary](https://github.com/cal-itp/data-infra/actions/runs/${{ github.run_id }})."
518+
edit-mode: replace

0 commit comments

Comments
 (0)