From f21025f5cd5aeb0f692bfb533b50033da8319538 Mon Sep 17 00:00:00 2001 From: Vladimir Komissarov Date: Thu, 31 Jan 2019 17:00:51 +0700 Subject: [PATCH] duplicate pull-request-info to .git/pr --- assets/in | 4 ++++ assets/out | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/assets/in b/assets/in index 086a855..fac35a7 100755 --- a/assets/in +++ b/assets/in @@ -75,6 +75,8 @@ if [[ "$bitbucket_type" == "server" ]]; then updated_at: $version.updated_at }' > pull-request-info + cp pull-request-info .git/pr + jq -n --argjson version "${version}" --argjson pr "${pr}" '{ version: $version, metadata: [ @@ -101,6 +103,8 @@ elif [[ "$bitbucket_type" == "cloud" ]]; then updated_at: $pr.created_on }' > pull-request-info + cp pull-request-info .git/pr + jq -n --argjson version "${version}" --argjson pr "${pr}" '{ version: $version, metadata: [ diff --git a/assets/out b/assets/out index 6bd506b..965a0ed 100755 --- a/assets/out +++ b/assets/out @@ -23,7 +23,7 @@ params=$(jq -rc '.params' < "${payload}") action=$(jq -rc '.action // ""' <<< "${params}") path="$(realpath "${PWD}"/"${path}")/" -pr=$(cat "${path}pull-request-info") +pr=$(cat "${path}.git/pr") eval_param() { eval echo "$(jq -r "${1}" <<< "${params}")"