From 139cf92cb51646c3cf1e50064cf39c3f5624a8c5 Mon Sep 17 00:00:00 2001 From: Jess Frazelle Date: Fri, 28 Sep 2018 16:38:42 -0400 Subject: [PATCH] fixup Signed-off-by: Jess Frazelle --- github-dev/cleanup-pr-branch | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/github-dev/cleanup-pr-branch b/github-dev/cleanup-pr-branch index 28c6534..3af2446 100755 --- a/github-dev/cleanup-pr-branch +++ b/github-dev/cleanup-pr-branch @@ -22,16 +22,16 @@ API_HEADER="Accept: application/vnd.github.${API_VERSION}+json" AUTH_HEADER="Authorization: token ${GITHUB_TOKEN}" main(){ - action=$(cat "$GITHUB_EVENT_PATH" | jq --raw-output .action) - merged=$(cat "$GITHUB_EVENT_PATH" | jq --raw-output .pull_request.merged) + action=$(jq --raw-output .action "$GITHUB_EVENT_PATH") + merged=$(jq --raw-output .pull_request.merged "$GITHUB_EVENT_PATH") echo "action: $action merged: $merged" if [[ "$action" == "closed" ]] && [[ "$merged" == "true" ]]; then # delete the branch. - ref=$(cat "$GITHUB_EVENT_PATH" | jq --raw-output .pull_request.head.ref) - owner=$(cat "$GITHUB_EVENT_PATH" | jq --raw-output .pull_request.head.repo.owner.login) - repo=$(cat "$GITHUB_EVENT_PATH" | jq --raw-output .pull_request.head.repo.name) + ref=$(jq --raw-output .pull_request.head.ref "$GITHUB_EVENT_PATH") + owner=$(jq --raw-output .pull_request.head.repo.owner.login "$GITHUB_EVENT_PATH") + repo=$(jq --raw-output .pull_request.head.repo.name "$GITHUB_EVENT_PATH") if [[ "$ref" == "master" ]]; then # Never delete the master branch.