Skip to content

Commit 765cb28

Browse files
committed
ci(release): fail fast on publish errors
1 parent 9509006 commit 765cb28

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

.github/workflows/release.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,5 +94,16 @@ jobs:
9494
- uses: actions/checkout@v4
9595
- uses: dtolnay/rust-toolchain@stable
9696
- name: Publish agentic-codebase crate
97-
run: cargo publish --token "${{ secrets.CARGO_REGISTRY_TOKEN }}"
98-
continue-on-error: true
97+
shell: bash
98+
run: |
99+
set -euo pipefail
100+
if ! output="$(cargo publish --token "${{ secrets.CARGO_REGISTRY_TOKEN }}" 2>&1)"; then
101+
echo "$output"
102+
if echo "$output" | grep -qi "already uploaded"; then
103+
echo "agentic-codebase already published for this version; continuing."
104+
else
105+
exit 1
106+
fi
107+
else
108+
echo "$output"
109+
fi

0 commit comments

Comments
 (0)