From 7df96e3c54f1915557c8da33e81a9efb7199f8ab Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Thu, 19 Dec 2024 09:35:56 -0800 Subject: [PATCH 1/2] Allow pasting PR url in create-release script Previously this script required you to get the actual PR ID. This update allows you to just paste in the PR URL directly, which is slightly faster. [skip changelog] --- scripts/create-release | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/create-release b/scripts/create-release index f37f33a12d6..63c458dc694 100755 --- a/scripts/create-release +++ b/scripts/create-release @@ -9,7 +9,7 @@ CHANGELOG_FILE=${CHANGELOG_FILE:-tmp/.changelog.md} GH_REPO=${GH_REPO:-18f/identity-idp} USAGE=" -${0} [PULL_REQUEST_NUMBER] +${0} [PULL_REQUEST_URL] Creates a new release based on the given PR having been merged. " @@ -21,6 +21,9 @@ fi PR="$1"; shift +# Allow just pasting the PR URL +PR=$(echo "$PR" | sed -E 's#https://github.com/18F/identity-idp/pull/([0-9]+).*#\1#') + if ! which gh > /dev/null 2>&1; then echo "Github CLI (gh) is not installed. You can install it with: brew install gh" exit 1 From 88dd33f86353dea787ba85009f4118f9774f08ad Mon Sep 17 00:00:00 2001 From: Matt Hinz Date: Fri, 20 Dec 2024 09:23:46 -0800 Subject: [PATCH 2/2] Use GH_REPO in the pattern passed to sed Also, make comparison case-insensitive (because technically we are 18F/identity-idp, not 18f/identity-idp? --- scripts/create-release | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/create-release b/scripts/create-release index 63c458dc694..605001a127a 100755 --- a/scripts/create-release +++ b/scripts/create-release @@ -6,7 +6,7 @@ DEPLOY_BRANCH=stages/prod DRY_RUN=${DRY_RUN:-0} PR_JSON_FILE=${PR_JSON_FILE:-tmp/.pr.json} CHANGELOG_FILE=${CHANGELOG_FILE:-tmp/.changelog.md} -GH_REPO=${GH_REPO:-18f/identity-idp} +GH_REPO=${GH_REPO:-18F/identity-idp} USAGE=" ${0} [PULL_REQUEST_URL] @@ -22,7 +22,7 @@ fi PR="$1"; shift # Allow just pasting the PR URL -PR=$(echo "$PR" | sed -E 's#https://github.com/18F/identity-idp/pull/([0-9]+).*#\1#') +PR=$(echo "$PR" | sed -E "s#https://github.com/${GH_REPO}/pull/([0-9]+).*#\1#i") if ! which gh > /dev/null 2>&1; then echo "Github CLI (gh) is not installed. You can install it with: brew install gh"