Skip to content

Commit

Permalink
move merge error logic back to workflow , ci-run-diff
Browse files Browse the repository at this point in the history
  • Loading branch information
georgemccabe committed Jan 25, 2024
1 parent bdc0877 commit bb75588
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
10 changes: 0 additions & 10 deletions .github/jobs/check_for_error_logs.sh

This file was deleted.

11 changes: 10 additions & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,16 @@ jobs:
- uses: actions/checkout@v4
- name: Check for error logs
id: check-for-error-logs
run: .github/jobs/check_for_error_logs.sh
run: |
json_data=$(curl -s -H "Authorization: Bearer ${{ github.token }}" \
"https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs")
error_log_jobs=($(echo "$json_data" | jq -r '.jobs[] | select(.name | startswith("Use Case Tests")) | .steps[] | select(.name | startswith("Save error logs")) | select(.conclusion | startswith("success"))'))
# save output variable to merge error logs if any error logs were created
if [ ! -z "${error_log_jobs}" ]; then
echo "has_error_logs=true" >> $GITHUB_OUTPUT
else
echo "has_error_logs=false" >> $GITHUB_OUTPUT
fi
- name: Merge Artifacts
if: ${{ always() && steps.check-for-error-logs.outputs.has_error_logs == 'true' }}
uses: actions/upload-artifact/merge@v4
Expand Down

0 comments on commit bb75588

Please sign in to comment.