fix(ci): notify-chart-dev gate avoids SIGPIPE; add workflow_dispatch
The gate step's `git tag --points-at HEAD | grep -q '^zddc-server-v'` exits 141 (SIGPIPE) under bash's pipefail when grep finishes early — the runner's strict-mode wrapper then fails the step even though the if-condition logic completed correctly. Materialize the tag list with git's native --list glob filter and test it with `[ -n ]` instead, so no pipeline is involved. Also add workflow_dispatch so we can re-fire this workflow on a fresh commit without needing a no-op edit under zddc/internal/apps/embedded/ to match the paths filter.
This commit is contained in:
parent
b14d8a3e38
commit
4a78ce4473
1 changed files with 12 additions and 2 deletions
|
|
@ -18,6 +18,10 @@ on:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
paths:
|
paths:
|
||||||
- 'zddc/internal/apps/embedded/**'
|
- 'zddc/internal/apps/embedded/**'
|
||||||
|
# Manual trigger — useful for re-firing after a workflow fix without
|
||||||
|
# also having to make a no-op embedded/ change to satisfy the paths
|
||||||
|
# filter. Run on the latest main commit; gate-step still applies.
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
notify-chart-dev:
|
notify-chart-dev:
|
||||||
|
|
@ -39,9 +43,15 @@ jobs:
|
||||||
id: gate
|
id: gate
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
if git tag --points-at HEAD | grep -q '^zddc-server-v'; then
|
# Avoid `git tag | grep -q ^zddc-server-v` — under bash's
|
||||||
|
# default `pipefail`, grep -q closing stdin early gives git
|
||||||
|
# SIGPIPE (exit 141), which the runner's strict-mode wrapper
|
||||||
|
# treats as a step failure even though the if-condition logic
|
||||||
|
# is correct. Materialize the tag list first, then test it.
|
||||||
|
STABLE_TAGS=$(git tag --points-at HEAD --list 'zddc-server-v*')
|
||||||
|
if [ -n "$STABLE_TAGS" ]; then
|
||||||
echo "is_beta=false" >> "$GITHUB_OUTPUT"
|
echo "is_beta=false" >> "$GITHUB_OUTPUT"
|
||||||
echo "HEAD has zddc-server-v* tag — stable workflow handles this; skipping dev notify"
|
echo "HEAD has zddc-server-v* tag ($STABLE_TAGS) — stable workflow handles this; skipping dev notify"
|
||||||
else
|
else
|
||||||
echo "is_beta=true" >> "$GITHUB_OUTPUT"
|
echo "is_beta=true" >> "$GITHUB_OUTPUT"
|
||||||
echo "No stable tag at HEAD; treating as beta cut"
|
echo "No stable tag at HEAD; treating as beta cut"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue