Files
cascade-from/tests/bin/curl
Donavan FritzandClaude Opus 5.5 d3dce56c31
test / test (pull_request) Successful in 4s
[t-mmyx6d0xfp0x] fix: open a pull request when main is protected
Every cascade from base and base-dev has failed since August: runner,
base-dev and base-agent protect main against all pushes, so the direct
push is refused three times and the release job fails, and a refused
first target also skips the next cascade step. Push the bump to
cascade/<name>-<tag> and open a pull request instead, so it lands
through the target's review. Targets that still allow ci-bot to push
(fritzlab/agent) keep the direct push.

The script moves out of action.yaml into cascade.sh so tests/run can
drive it against local bare repositories and a stubbed API.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 11:33:13 -06:00

25 lines
624 B
Bash
Executable File

#!/usr/bin/env bash
# Gitea API stub for cascade.sh tests: logs each call, answers CURL_STATUS.
set -euo pipefail
out="" data="" url="" method=GET
while [ "$#" -gt 0 ]; do
case "$1" in
-o) out="$2"; shift 2 ;;
-X) method="$2"; shift 2 ;;
--data) data="$2"; shift 2 ;;
-w|-H) shift 2 ;;
http*) url="$1"; shift ;;
*) shift ;;
esac
done
printf '%s %s %s\n' "$method" "$url" "$data" >>"${CURL_LOG}"
status="${CURL_STATUS:-201}"
if [ "$status" = 201 ]; then
printf '{"html_url":"https://code.test/pulls/7"}' >"$out"
else
printf '{"message":"stub %s"}' "$status" >"$out"
fi
printf '%s' "$status"