File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55
66set -euo pipefail
77
8+ _td=" $( mktemp -d) "
9+ trap ' rm -rf "$_td"' EXIT
10+
811cmd=" $1 "
912shift
1013
@@ -23,7 +26,7 @@ case "$cmd" in
2326 ;;
2427
2528 current-policy)
26- body=" $( mktemp ) "
29+ body=" $_td /body "
2730 status=" $( curl -sS -o " $body " -w " %{http_code}" http://policy.local/v1/policy/current) "
2831 json_status_response " $status " " $body "
2932 ;;
@@ -34,8 +37,8 @@ case "$cmd" in
3437 branch=" $3 "
3538 file_path=" $4 "
3639 run_id=" $5 "
37- body=" $( mktemp ) "
38- payload=" $( mktemp ) "
40+ body=" $_td /body "
41+ payload=" $_td /payload "
3942
4043 python3 - " $branch " " $run_id " > " $payload " << 'PY '
4144import base64
7679 owner=" $1 "
7780 repo=" $2 "
7881 file_path=" $3 "
79- body=" $( mktemp ) "
80- payload=" $( mktemp ) "
82+ body=" $_td /body "
83+ payload=" $_td /payload "
8184
8285 python3 - " $owner " " $repo " " $file_path " > " $payload " << 'PY '
8386import json
140143 # — we never make outbound calls, the gateway just persists the
141144 # chunk and the reviewer decides on it.
142145 rule_id=" $1 "
143- body=" $( mktemp ) "
144- payload=" $( mktemp ) "
146+ body=" $_td /body "
147+ payload=" $_td /payload "
145148
146149 python3 - " $rule_id " > " $payload " << 'PY '
147150import json
184187
185188 proposal-status)
186189 chunk_id=" $1 "
187- body=" $( mktemp ) "
190+ body=" $_td /body "
188191 status=" $( curl -sS \
189192 -o " $body " \
190193 -w " %{http_code}" \
195198 proposal-wait)
196199 chunk_id=" $1 "
197200 timeout=" ${2:- 60} "
198- body=" $( mktemp ) "
201+ body=" $_td /body "
199202 # No --max-time on curl: the server bounds the wait at `timeout`,
200203 # which is already clamped to [1, 300] by policy.local. Let the
201204 # request return naturally.
You can’t perform that action at this time.
0 commit comments