diff options
| author | Teddy Wing | 2018-04-18 23:37:42 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2018-04-18 23:37:42 +0200 | 
| commit | 2e2e18f87a4a125b6cd3ec87c66df20c5df87cdb (patch) | |
| tree | 7789f9824312cb54c96e0478f3779682319ddeae | |
| parent | df8d82f4d05d3f1361af092720ac172944642b77 (diff) | |
| download | redprine-2e2e18f87a4a125b6cd3ec87c66df20c5df87cdb.tar.bz2 | |
Replace `github_owner_repo()` function with value from argument
Get this value from a command line argument instead of getting it from
the repository. Doing this because I want this script to be able to be
executed outside the context of a Git repository, meaning that we won't
necessarily have access to these values intrinsically.
| -rwxr-xr-x | redprine | 12 | 
1 files changed, 1 insertions, 11 deletions
| @@ -32,23 +32,13 @@ Flags:  __EOF__  } -function github_owner_repo () { -	local git_remote=$(git remote get-url origin) -	local owner_repo=$(echo "$git_remote" | -		sed -e 's/git@github.com://' \ -			-e 's/.git$//') - -	echo "$owner_repo" -} -  # Get a list of open pull requests from the GitHub API.  function fetch_pull_requests () { -	local owner_repo=$(github_owner_repo)  	local pull_requests=$(curl \  		--silent \  		--header 'Accept:application/vnd.github.v3+json' \  		--header "Authorization: Bearer ${GITHUB_TOKEN}" \ -		--location "https://api.github.com/repos/${owner_repo}/pulls") +		--location "https://api.github.com/repos/${GITHUB_OWNER_REPO}/pulls")  	echo "$pull_requests"  } | 
