File tree Expand file tree Collapse file tree 1 file changed +19
-8
lines changed
Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Original file line number Diff line number Diff line change 3333 needs : find-tox-testenv
3434 if : ${{ needs.find-tox-testenv.outputs.list != '[]' }}
3535 runs-on : ubuntu-latest
36- continue-on-error : true
3736 strategy :
3837 fail-fast : false
3938 matrix :
@@ -61,29 +60,41 @@ jobs:
6160 slack :
6261 name : Slack notification
6362 needs : canary
63+ if : ${{ always() }}
6464 runs-on : ubuntu-latest
65+ env :
66+ RUN_URL : ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
6567 steps :
6668 - uses : actions/download-artifact@v4
67- - name : List failures as markdown
69+ if : ${{ needs.canary.result == 'failure' }}
70+ - name : List failures
71+ if : ${{ needs.canary.result == 'failure' }}
6872 run : |
6973 {
7074 echo "list<<EOF"
71- find . -maxdepth 1 -type d ! -name '.' | sed 's|^\./||' | rev | sort -u | rev | nl -w2 -s'. '
75+ find . -maxdepth 1 -type d ! -name '.' | sed 's|^\./||' | sort | nl -w2 -s'. '
7276 echo "EOF"
7377 } >> "$GITHUB_OUTPUT"
7478 id : failures
75- - name : Create message text
76- if : ${{ steps.failures.outputs.list != '' }}
79+ - name : Build message
80+ env :
81+ CANARY_RESULT : ${{ needs.canary.result }}
82+ FAILURE_LIST : ${{ steps.failures.outputs.list }}
7783 run : |
84+ if [ "$CANARY_RESULT" = "failure" ]; then
85+ MSG="Python canary cron failed:
86+ $FAILURE_LIST
87+ $RUN_URL"
88+ else
89+ MSG="Python canary cron passed: $RUN_URL"
90+ fi
7891 {
7992 echo "text<<EOF"
80- echo "CI Failures for Python Packages:"
81- echo "${{ steps.failures.outputs.list }}"
93+ echo "$MSG"
8294 echo "EOF"
8395 } >> "$GITHUB_OUTPUT"
8496 id : message
8597 - name : Send message to Slack
86- if : ${{ steps.failures.outputs.list != '' }}
8798 uses : slackapi/slack-github-action@v1
8899 with :
89100 payload : |
You can’t perform that action at this time.
0 commit comments