Skip to content
This repository was archived by the owner on Dec 2, 2020. It is now read-only.

Commit 010c8d3

Browse files
committed
Merge branch 'target_url_path' of https://github.com/rafw87/github-status-resource into rafw87-target_url_path
#10
2 parents 087c11e + 7533174 commit 010c8d3

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

bin/out

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ eval $( jq -r '{
1010
"params_state": .params.state,
1111
"params_description": ( .params.description // "" ),
1212
"params_description_path": ( .params.description_path // "" ),
13-
"params_target_url": ( .params.target_url // "$ATC_EXTERNAL_URL/builds/$BUILD_ID" )
13+
"params_target_url": ( .params.target_url // ""),
14+
"params_target_url_path": ( .params.target_url_path // "" )
1415
} | to_entries[] | .key + "=" + @sh "\(.value)"' < /tmp/stdin )
1516

1617

@@ -59,10 +60,14 @@ fi
5960
# target_url
6061
#
6162

62-
target_url=""
63+
target_url_path="/tmp/target_url"
6364

64-
if [ -n "$params_target_url" ] ; then
65-
target_url=$( echo "$params_target_url" | buildtpl )
65+
if [[ -n "$params_target_url" ]] ; then
66+
echo "$params_target_url" > "$target_url_path"
67+
elif [[ -n "$params_target_url_path" ]] ; then
68+
cp "$params_target_url_path" "$target_url_path"
69+
else
70+
echo "$ATC_EXTERNAL_URL/builds/$BUILD_ID" > "$target_url_path"
6671
fi
6772

6873

@@ -72,7 +77,7 @@ fi
7277

7378
jq -c -n \
7479
--arg state "$params_state" \
75-
--arg target_url "$target_url" \
80+
--arg target_url "$( cat $target_url_path | buildtpl )" \
7681
--arg description "$( cat $description_path )" \
7782
--arg context "$source_context" \
7883
'{

0 commit comments

Comments
 (0)