From 29fcca2fcae4b6120bfe02c51532dd4baf98445c Mon Sep 17 00:00:00 2001 From: Tore Martin Hagen Date: Thu, 5 Sep 2024 07:47:01 +0200 Subject: [PATCH] Removed never-alone from release template, fixed up some jq magic --- bin/never_alone/get_commit_and_pr_info.sh | 14 +++++++++----- release-flow-template.yml | 4 ---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bin/never_alone/get_commit_and_pr_info.sh b/bin/never_alone/get_commit_and_pr_info.sh index 7b81e28cb..cee1d04d5 100755 --- a/bin/never_alone/get_commit_and_pr_info.sh +++ b/bin/never_alone/get_commit_and_pr_info.sh @@ -70,13 +70,17 @@ function get_never_alone_data local -r result_file=$1; shift pr_data=$(gh pr list --search "${commit}" --state merged --json author,reviews,mergeCommit,mergedAt,reviewDecision,url) - pr_data_0=$(echo "$pr_data" | jq '.[0]') - commit_data=$(gh search commits --hash "${commit}" --json commit) - commit_data_0=$(echo "$commit_data" | jq '.[0]') - commit_info=$(echo $commit_data_0 | jq '.commit') - echo "{\"sha\": \"${commit}\", \"commit\": ${commit_info},\"pullRequest\": ${pr_data_0}}" | jq . > "${result_file}" + jq -n \ + --arg sha "$commit" \ + --argjson commit "$commit_data" \ + --argjson pullRequest "$pr_data" \ + '{ + sha: $sha, + commit: $commit[0].commit, + pullRequest: $pullRequest[0] + }' > "${result_file}" } diff --git a/release-flow-template.yml b/release-flow-template.yml index 61d2ed519..dc67d14e1 100644 --- a/release-flow-template.yml +++ b/release-flow-template.yml @@ -7,10 +7,6 @@ trail: type: junit - name: snyk-code type: snyk - - name: never-alone-data - type: generic - - name: never-alone-control - type: generic artifacts: - name: cli-docker attestations: