Skip to content

Commit 2db992d

Browse files
authored
hotfix for circleci summary workflow (#42708)
hotfix Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
1 parent 0e51e7a commit 2db992d

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

.github/workflows/circleci-failure-summary-comment.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,9 @@ jobs:
111111
failure_summary_url=$(echo "$artifacts" | jq -r '.items[] | select(.path == "outputs/failure_summary.json") | .url')
112112
113113
if [ -z "$failure_summary_url" ]; then
114-
echo "failure_summary.json not found in artifacts"
115-
exit 1
114+
echo "failure_summary.json not found in artifacts - PR may not have latest main merged. Skipping."
115+
echo "artifact_found=false" >> $GITHUB_OUTPUT
116+
exit 0
116117
fi
117118
118119
echo "Downloading failure_summary.json from: ${failure_summary_url}"
@@ -123,18 +124,21 @@ jobs:
123124
echo "Downloaded failure_summary.json successfully"
124125
125126
# Verify the file was downloaded
126-
if [ -f outputs/failure_summary.json ]; then
127-
echo "File size: $(wc -c < outputs/failure_summary.json) bytes"
128-
else
129-
echo "Failed to download failure_summary.json"
130-
exit 1
127+
if [ ! -f outputs/failure_summary.json ]; then
128+
echo "Failed to download failure_summary.json - skipping."
129+
echo "artifact_found=false" >> $GITHUB_OUTPUT
130+
exit 0
131131
fi
132132
133+
echo "File size: $(wc -c < outputs/failure_summary.json) bytes"
134+
133135
# Export variables for next steps
136+
echo "artifact_found=true" >> $GITHUB_OUTPUT
134137
echo "workflow_id=${workflow_id}" >> $GITHUB_OUTPUT
135138
echo "collection_job_number=${collection_job_number}" >> $GITHUB_OUTPUT
136139
137140
- name: Upload summaries to Hub
141+
if: steps.circleci.outputs.artifact_found == 'true'
138142
env:
139143
HF_TOKEN: ${{ secrets.HF_CI_WRITE_TOKEN }}
140144
CIRCLECI_RESULTS_DATASET_ID: "transformers-community/circleci-test-results"
@@ -170,6 +174,7 @@ jobs:
170174
EOF
171175
172176
- name: Post comment with helper link
177+
if: steps.circleci.outputs.artifact_found == 'true'
173178
env:
174179
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
175180
GITHUB_REPOSITORY: ${{ github.repository }}

0 commit comments

Comments
 (0)