aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2018-04-18 23:37:42 +0200
committerTeddy Wing2018-04-18 23:37:42 +0200
commit2e2e18f87a4a125b6cd3ec87c66df20c5df87cdb (patch)
tree7789f9824312cb54c96e0478f3779682319ddeae
parentdf8d82f4d05d3f1361af092720ac172944642b77 (diff)
downloadredprine-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-xredprine12
1 files changed, 1 insertions, 11 deletions
diff --git a/redprine b/redprine
index a212d3c..12cda44 100755
--- a/redprine
+++ b/redprine
@@ -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"
}