Skip to content

Commit

Permalink
strip leading and trailing quotes from url
Browse files Browse the repository at this point in the history
  • Loading branch information
Raymond Gasper committed May 26, 2020
1 parent f64c007 commit c6b976c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion run_black_on_git_diff_adds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ fi

set -x

echo -En ${GITHUB_EVENT_PATH}
github_pr_url=`jq '.pull_request.url' ${GITHUB_EVENT_PATH}`
# github pr url sometimes has leading and trailing quotes
github_pr_url=`sed -e 's/^"//' -e 's/"$//' <<<"$github_pr_url"`
github_diff=`curl --request GET --url ${github_pr_url} --header "authorization: Bearer ${GITHUB_TOKEN}" --header "Accept: application/vnd.github.v3.diff"`
list_of_edited_files=`echo -En ${github_diff} | grep -E -- "\+\+\+ " | awk '{print $2}' | grep -Po -- "(?<=[ab]/).+(.py$)"`

Expand Down

0 comments on commit c6b976c

Please sign in to comment.