mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-10-22 13:11:55 +00:00
ci: pass the branch name to jq as an argument in the iOS artifact lookup
The branch name was part of the jq program text, so a branch named to close the string could select an artifact from a fork or another branch. Same fix as the desktop lookup.
This commit is contained in:
1 parent
c67ea513f3
commit
cbb2480b4e
1 file changed
+3
-3
@@ -8,10 +8,10 @@
|
||||
set -euo pipefail
|
||||
|
||||
name=$1
|
||||
run_id=$(gh api "repos/$GITHUB_REPOSITORY/actions/artifacts?name=$name&per_page=100" --jq "
|
||||
run_id=$(gh api "repos/$GITHUB_REPOSITORY/actions/artifacts?name=$name&per_page=100" | jq -r --arg branch "$GITHUB_REF_NAME" '
|
||||
[.artifacts[]
|
||||
| select((.expired | not) and .workflow_run.head_branch == \"$GITHUB_REF_NAME\" and .workflow_run.head_repository_id == .workflow_run.repository_id)]
|
||||
| sort_by(.created_at) | last | .workflow_run.id // empty")
|
||||
| select((.expired | not) and .workflow_run.head_branch == $branch and .workflow_run.head_repository_id == .workflow_run.repository_id)]
|
||||
| sort_by(.created_at) | last | .workflow_run.id // empty')
|
||||
if [ -n "$run_id" ]; then
|
||||
echo "$name: from run $run_id"
|
||||
echo "run-id=$run_id" >> "$GITHUB_OUTPUT"
|
||||
|
||||
Reference in new issue
Block a user