@@ -2,7 +2,7 @@ name: Build fakeProfile
22
33on :
44 schedule :
5- - cron : " */10 * * * *"
5+ - cron : " */5 * * * *"
66 workflow_dispatch :
77 inputs :
88 project :
@@ -77,21 +77,20 @@ jobs:
7777 run : |
7878 UPSTREAM_SHA=$(git rev-parse HEAD)
7979 echo "commit_sha=${UPSTREAM_SHA}" >> $GITHUB_OUTPUT
80- echo "commit_sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
80+ echo "commit_sha_short=$(git rev-parse --short=7 HEAD)" >> $GITHUB_OUTPUT
8181 tag_name="build-${{ matrix.project }}-${UPSTREAM_SHA}"
8282 if [[ "${{ github.event_name }}" == "workflow_dispatch" && "${{ github.event.inputs.run_as_schedule }}" != "true" ]]; then
8383 tag_name="${tag_name}-Forced"
8484 fi
8585 echo "tag_name=${tag_name}" >> $GITHUB_OUTPUT
86- SHA_DISPLAY="[\`$(git rev-parse --short HEAD)\`](https://github.com/${{ matrix.repo }}/commit/$(git rev-parse HEAD))"
86+ SHA_DISPLAY="[\`$(git rev-parse --short=7 HEAD)\`](https://github.com/${{ matrix.repo }}/commit/$(git rev-parse HEAD))"
8787 LAST_BUILT_SHA=""
8888 if [[ -f ../last_successful_sha_${{ matrix.project }}.txt ]]; then
8989 LAST_BUILT_SHA=$(cat ../last_successful_sha_${{ matrix.project }}.txt)
90- LAST_BUILT_SHA_SHORT=$(git rev-parse --short $LAST_BUILT_SHA)
90+ LAST_BUILT_SHA_SHORT=$(git rev-parse --short=7 $LAST_BUILT_SHA)
9191 echo "last_commit_sha=${LAST_BUILT_SHA}" >> $GITHUB_OUTPUT
9292 echo "last_commit_sha_short=${LAST_BUILT_SHA_SHORT}" >> $GITHUB_OUTPUT
9393 COMMIT_LOG=$(git log --pretty=format:"- %s - %an - [%h](https://github.com/${{ matrix.repo }}/commit/%H)" $LAST_BUILT_SHA..HEAD)
94- SHA_DISPLAY="[\`${LAST_BUILT_SHA_SHORT}\`](https://github.com/${{ matrix.repo }}/commit/${LAST_BUILT_SHA}) > ${SHA_DISPLAY}"
9594 else
9695 COMMIT_LOG=$(git log -1 --pretty=format:"- %s - %an - [%h](https://github.com/${{ matrix.repo }}/commit/%H)")
9796 fi
@@ -310,10 +309,18 @@ jobs:
310309 - name : Capture build error details
311310 if : failure()
312311 id : capture_error
312+ env :
313+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
314+ PROJECT_NAME : ${{ matrix.project }}
313315 run : |
314- echo "error_step=${{ join(matrix.project) }} failed at step '${{ github.job }}'" >> $GITHUB_OUTPUT
316+ log_data=$(ts-node src/get-failed-step-log.ts)
317+ log_content=$(echo "$log_data" | jq -r .log)
318+ step_name=$(echo "$log_data" | jq -r .stepName)
319+ echo "failed_command<<EOF" >> $GITHUB_OUTPUT
320+ echo "$log_content" >> $GITHUB_OUTPUT
321+ echo "EOF" >> $GITHUB_OUTPUT
322+ echo "error_step=$step_name" >> $GITHUB_OUTPUT
315323 echo "log_url=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> $GITHUB_OUTPUT
316- echo "failed_command=$(tail -n 20 ${{ runner.temp }}/_temp/step*.log)" >> $GITHUB_OUTPUT
317324
318325 - name : Restore last failure notification timestamp
319326 if : failure()
@@ -347,19 +354,19 @@ jobs:
347354 embed-description : |
348355 ## ❌ Build Failure Details
349356 **Project:** ${{ matrix.project }}
350- **Failed Step:** ${{ steps.capture_error.outputs.error_step }}
357+ **Failed Step:** ` ${{ steps.capture_error.outputs.error_step }}`
351358 **Workflow Run:** [#${{ github.run_id }}](${{ steps.capture_error.outputs.log_url }})
352359 **Branch:** `${{ github.ref }}`
353-
354- ## 📝 Last Command Output
360+
361+ ## 📝 Log Output
355362 ```text
356363 ${{ steps.capture_error.outputs.failed_command }}
357364 ```
358365
359366 ## 🛠️ Required Action
360- 1. Check the [complete logs](${{ steps.capture_error.outputs.log_url }})
361- 2. Verify recent code changes
362- 3. Re-run workflow after fixes
367+ 1. Check the [complete logs](${{ steps.capture_error.outputs.log_url }}) for more details.
368+ 2. Review the failed step and the log output above to diagnose the issue.
369+ 3. Re-run the workflow after applying the necessary fixes.
363370 embed-color : 0xe74c3c
364371 embed-footer-text : " Failure detected at ${{ steps.current-time.outputs.footer_time }}"
365372 embed-footer-icon-url : " https://avatars.githubusercontent.com/u/221838119?s=200&v=4"
@@ -369,9 +376,3 @@ jobs:
369376 run : |
370377 echo "$(date +%s)" > last_failure_notification_timestamp_${{ matrix.project }}.txt
371378
372- - name : Cache failure notification timestamp
373- if : failure() && steps.decide_failure_notification.outputs.should_notify == 'true'
374- uses : actions/cache/save@v4
375- with :
376- path : last_failure_notification_timestamp_${{ matrix.project }}.txt
377- key : failure-notification-timestamp-${{ matrix.project }}
0 commit comments