@@ -2,7 +2,7 @@ name: build
22
33on :
44 schedule :
5- - cron : " 23 */6 * * *" # pick up new upstream stable releases
5+ - cron : " 23 5 * * *" # daily: pick up new upstream stable releases
66 push :
77 branches : [main]
88 paths :
@@ -26,6 +26,8 @@ concurrency:
2626jobs :
2727 build :
2828 runs-on : ubuntu-latest
29+ outputs :
30+ version : ${{ steps.version.outputs.version }}
2931 strategy :
3032 fail-fast : false
3133 matrix :
@@ -88,12 +90,27 @@ jobs:
8890 ${{ env.IMAGE }}:${{ steps.version.outputs.version }}
8991 ${{ env.IMAGE }}:latest
9092
91- - name : Notify Slack on failure
92- if : failure()
93+ # One Slack message per breakage, not per matrix leg or per scheduled
94+ # retry: skip posting when the previous completed run also failed.
95+ notify :
96+ runs-on : ubuntu-latest
97+ needs : build
98+ if : failure()
99+ steps :
100+ - name : Check previous run conclusion
101+ id : prev
102+ env :
103+ GH_TOKEN : ${{ github.token }}
104+ run : |
105+ PREV="$(gh api "repos/${{ github.repository }}/actions/workflows/build.yml/runs?status=completed&per_page=1" --jq '.workflow_runs[0].conclusion')"
106+ echo "conclusion=$PREV" | tee -a "$GITHUB_OUTPUT"
107+
108+ - name : Post to Slack
109+ if : steps.prev.outputs.conclusion != 'failure'
93110 env :
94111 SLACK_BOT_TOKEN : ${{ secrets.SLACK_BOT_TOKEN }}
95112 SLACK_CHANNEL_ID : ${{ vars.SLACK_CHANNEL_ID }}
96- TEXT : " :rotating_light: ${{ matrix.package }} build failed for LiteLLM ${{ steps.version .outputs.version || 'unknown' }} — the patch may no longer apply. ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
113+ TEXT : " :rotating_light: litellm-lagoon-base build failed for LiteLLM ${{ needs.build .outputs.version || 'unknown' }} — the patch may no longer apply. ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
97114 run : |
98115 curl -fsS -X POST https://slack.com/api/chat.postMessage \
99116 -H "Authorization: Bearer $SLACK_BOT_TOKEN" \
0 commit comments