diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 266ce55..fc2f26a 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -23,6 +23,11 @@ on: description: "CLI version to test (e.g. 0.1.16). Empty = latest release." required: false default: "" + test_alert: + description: "Also fire the Slack alert on this manual run if e2e fails (for testing the notify job)." + type: boolean + required: false + default: false schedule: - cron: "0 6 * * *" @@ -133,17 +138,18 @@ jobs: [ -n "$MARKERS" ] && args+=(-m "$MARKERS") uv run --project tests/e2e pytest tests/e2e "${args[@]}" - # Alert Slack when any e2e leg does not succeed. Runs only on the nightly - # schedule — manual dispatch is interactive, so the operator already sees the - # result. `result != 'success'` covers both failures and cancellations (the - # 30-min job timeout cancels rather than fails), so timed-out nightly runs - # still alert. Needs the SLACK_WEBHOOK_URL repo secret (a Slack Incoming - # Webhook URL; the target channel is fixed by the webhook). Self-skips if the - # secret is unset. + # Alert Slack when any e2e leg does not succeed. Fires on the nightly + # schedule (manual dispatch is interactive, so the operator already sees the + # result) — or on a manual run started with test_alert=true, to verify the + # notify path on demand without waiting for the cron. `result != 'success'` + # covers both failures and cancellations (the 30-min job timeout cancels + # rather than fails), so timed-out nightly runs still alert. Needs the + # SLACK_WEBHOOK_URL repo secret (a Slack Incoming Webhook URL; the target + # channel is fixed by the webhook). Self-skips if the secret is unset. notify: name: notify-slack-on-failure needs: e2e - if: ${{ always() && github.event_name == 'schedule' && needs.e2e.result != 'success' }} + if: ${{ always() && needs.e2e.result != 'success' && (github.event_name == 'schedule' || inputs.test_alert) }} runs-on: ubuntu-latest steps: - name: Post failure to Slack