File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff 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.'
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
You can’t perform that action at this time.
0 commit comments