Skip to content

Commit 52680b8

Browse files
committed
ci(check-pr): no need for echo
1 parent f3832b9 commit 52680b8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

.github/workflows/check-pr.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ jobs:
1919
# Check the commits
2020
commits_json=$(curl -fsSL -H "Authorization: token ${GITHUB_TOKEN}" "${PR_COMMITS_URL}")
2121
echo -n 'Commits: '
22-
echo "${commits_json}" | jq '.'
23-
commit_count="$(echo "${commits_json}" | jq -r 'length')"
22+
jq '.' <<<"${commits_json}"
23+
commit_count="$(jq -r 'length' <<<"${commits_json}")"
2424
# Check first commit message (except for dependabot who is inconsistent)
2525
if [ "${commit_count}" -eq 1 ] && [ "${GITHUB_ACTOR}" != 'dependabot[bot]' ] ; then
26-
commit_title="$(echo "${commits_json}" | jq -r '.[0].commit.message' | head -n 1)"
26+
commit_title="$(jq -r '.[0].commit.message' <<<"${commits_json}" | head -n 1)"
2727
echo "Commit title: ${commit_title}"
2828
if [[ "${commit_title}" != "${PR_TITLE}" ]] ; then
2929
>&2 echo 'Single commit must have same title as PR.'
@@ -32,8 +32,8 @@ jobs:
3232
fi
3333
# Check that all commits are signed
3434
for ((i = 0 ; i < commit_count ; i++ )); do
35-
if [[ "$(echo "${commits_json}" | jq -r ".[${i}].commit.verification.verified")" == 'false' ]] ; then
36-
>&2 echo "Commit $(echo "${commits_json}" | jq -r ".[${i}].sha") must be signed."
35+
if [[ "$(jq -r ".[${i}].commit.verification.verified" <<<"${commits_json}")" == 'false' ]] ; then
36+
>&2 echo "Commit $(jq -r ".[${i}].sha" <<<"${commits_json}") must be signed."
3737
exit 1
3838
fi
3939
done

0 commit comments

Comments
 (0)