Skip to content

Commit

Permalink
Fix quotation issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthony Lucillo committed Jan 31, 2019
1 parent f21025f commit 606ce51
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions assets/check
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ if [[ "$bitbucket_type" == "server" ]]; then
id: .id | tostring,
title: .title | tostring,
branch: .fromRef.id | tostring | (capture("refs/heads/(?<branch>.+)").branch // .),
commit: .fromRef.latestCommit,
commit: .fromRef.latestCommit,
updated_at: .updatedDate | tostring
})
| map(select(if .title | test("wip"; "i") then false else true end))
Expand All @@ -74,8 +74,8 @@ elif [[ "$bitbucket_type" == "cloud" ]]; then

# get the commit date, which is when the PR last got updated code-wise.
# the updated_on field in the PR also changes when comment added etc
date=$(curl -s --fail -u "${username}:${password}" $commit_url | jq -r '.date')
date=$(curl -s --fail -u "${username}:${password}" $commit_url | jq -r '.date')

prs+="+ [{id:\"$id\", title: \"$title\", branch: \"$branch\", commit:\"$commit\", updated_at:\"$date\"}]"
done < <(jq -c '.[]' "${response}")

Expand All @@ -86,7 +86,7 @@ elif [[ "$bitbucket_type" == "cloud" ]]; then

# take the list of PRs | filter out containing "wip" in title | sort by update-date of commits | remove the date | pick latest PR, wrap as array for concourse
jq -n "[ $prs
| map(select(if .title | test('wip'; 'i') then false else true end))
| map(select(if .title | test(\"wip\"; \"i\") then false else true end))
| sort_by(.updated_at)
| map(del(.updated_at))
| .[-1] ]" >&3
Expand Down

0 comments on commit 606ce51

Please sign in to comment.