[t-mmyx6d0xfp0x] fix: open a pull request when main is protected (#1)
test / test (push) Successful in 5s
test / test (push) Successful in 5s
This commit was merged in pull request #1.
This commit is contained in:
1 parent
43875de6b4
commit
f8ea90faaa
6 files changed
+238
-56
No files matched your search
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/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"
|
||||
Reference in new issue
Block a user