Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions .github/workflows/verify_data_integrity_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,17 @@ jobs:
- name: Read metadata
id: meta
run: |
echo "pr_number=${{ github.event.workflow_run.pull_requests[0].number }}" >> "$GITHUB_OUTPUT"
PR_NUMBER="${{ github.event.workflow_run.pull_requests[0].number }}"
if [ -z "$PR_NUMBER" ] && [ -s /tmp/validation-artifacts/pr_number ]; then
PR_NUMBER=$(cat /tmp/validation-artifacts/pr_number)
echo "::warning::pull_requests context empty, using artifact fallback"
fi
if [ -z "$PR_NUMBER" ]; then
echo "::error::Could not determine PR number"
exit 1
fi
echo "pr_number=$PR_NUMBER" >> "$GITHUB_OUTPUT"

if [ -s /tmp/validation-artifacts/result ]; then
echo "result=$(cat /tmp/validation-artifacts/result)" >> "$GITHUB_OUTPUT"
else
Expand All @@ -39,15 +49,15 @@ jobs:
uses: peter-evans/find-comment@v3
id: find_comment
with:
issue-number: ${{ github.event.workflow_run.pull_requests[0].number }}
issue-number: ${{ steps.meta.outputs.pr_number }}
comment-author: "github-actions[bot]"
body-includes: "<!-- data-validator -->"

- name: Post or update validation failure comment
if: steps.meta.outputs.result == 'failure'
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.workflow_run.pull_requests[0].number }}
issue-number: ${{ steps.meta.outputs.pr_number }}
comment-id: ${{ steps.find_comment.outputs.comment-id }}
body-path: /tmp/validation-artifacts/validation_report.md
edit-mode: replace
Expand Down
16 changes: 13 additions & 3 deletions .github/workflows/visualize_stopping_patterns_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,17 @@ jobs:
- name: Read metadata
id: meta
run: |
echo "pr_number=${{ github.event.workflow_run.pull_requests[0].number }}" >> "$GITHUB_OUTPUT"
PR_NUMBER="${{ github.event.workflow_run.pull_requests[0].number }}"
if [ -z "$PR_NUMBER" ] && [ -s /tmp/visualize-artifacts/pr_number ]; then
PR_NUMBER=$(cat /tmp/visualize-artifacts/pr_number)
echo "::warning::pull_requests context empty, using artifact fallback"
fi
if [ -z "$PR_NUMBER" ]; then
echo "::error::Could not determine PR number"
exit 1
fi
echo "pr_number=$PR_NUMBER" >> "$GITHUB_OUTPUT"

if [ -s /tmp/visualize-artifacts/has_changes ]; then
echo "has_changes=$(cat /tmp/visualize-artifacts/has_changes)" >> "$GITHUB_OUTPUT"
else
Expand All @@ -41,15 +51,15 @@ jobs:
uses: peter-evans/find-comment@v3
id: find_comment
with:
issue-number: ${{ github.event.workflow_run.pull_requests[0].number }}
issue-number: ${{ steps.meta.outputs.pr_number }}
comment-author: "github-actions[bot]"
body-includes: "<!-- station-visualizer -->"

- name: Post or update comment
if: steps.meta.outputs.has_changes == 'true'
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.workflow_run.pull_requests[0].number }}
issue-number: ${{ steps.meta.outputs.pr_number }}
comment-id: ${{ steps.find_comment.outputs.comment-id }}
body-path: /tmp/visualize-artifacts/visualization_comment.md
edit-mode: replace
Expand Down