diff --git a/.github/workflows/deploy-dbt.yml b/.github/workflows/deploy-dbt.yml index eecc9c3214..fac1bfa8a2 100644 --- a/.github/workflows/deploy-dbt.yml +++ b/.github/workflows/deploy-dbt.yml @@ -440,9 +440,6 @@ jobs: - name: Setup Graphviz uses: ts-graphviz/setup-graphviz@v2 - - name: Setup Continuous Machine Learning tools - uses: iterative/setup-cml@v2 - - name: Setup Python uses: actions/setup-python@v5 with: @@ -479,10 +476,15 @@ jobs: - name: Download latest artifacts from production dbt docs working-directory: warehouse - run: gsutil cp gs://calitp-dbt-docs/*.json ./target/latest/ + run: gsutil cp gs://calitp-dbt-artifacts/latest/*.json ./target/latest/ + + - name: Setup Continuous Machine Learning tools + uses: iterative/setup-cml@v2 - name: Create CI report working-directory: warehouse + env: + REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: poetry run python scripts/visualize.py ci-report --latest-dir='./target/latest/' - name: Archive CI report @@ -494,7 +496,24 @@ jobs: warehouse/target/dag.png - name: Create GitHub comment + id: report-comment working-directory: warehouse + continue-on-error: true env: REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: cml comment update target/report.md || echo "Failed to generate GitHub comment" + run: cml comment update target/report.md + + - uses: peter-evans/find-comment@v3 + if: ${{ steps.report-comment.outcome == 'failure' }} + id: fc + with: + issue-number: ${{ github.event.number }} + body-includes: "Failed to add ci-report to a comment" + + - uses: peter-evans/create-or-update-comment@v4 + if: ${{ steps.report-comment.outcome == 'failure' }} + with: + comment-id: ${{ steps.fc.outputs.comment-id }} + issue-number: ${{ github.event.number }} + 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 }})." + edit-mode: replace