fix: lib: use temporary unique file name
The function may be called from scripts that run under different users and re-using the same file name will run into problems: /home/debian/.cache/act/2cc577985400de79/hostexecutor/lib/lib.sh: line 96: /tmp/page: Permission denied curl: (23) Failure writing output to destination
This commit is contained in:
parent
327386d195
commit
e03278e4c1
1 changed files with 4 additions and 3 deletions
|
|
@ -92,10 +92,11 @@ function retry() {
|
|||
function get_versions() {
|
||||
local releases=$1
|
||||
local page=1
|
||||
local tmp=$(mktemp)
|
||||
while true; do
|
||||
curl --fail -sS "$releases?limit=100&page=$page" | jq -r '.[] | .tag_name' >/tmp/page
|
||||
cat /tmp/page
|
||||
if ! test -s /tmp/page; then
|
||||
curl --fail -sS "$releases?limit=100&page=$page" | jq -r '.[] | .tag_name' >$tmp
|
||||
cat $tmp
|
||||
if ! test -s $tmp; then
|
||||
break
|
||||
fi
|
||||
page=$(expr $page + 1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue