summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2021-03-01 13:39:37 -0800
committerGitHub <noreply@github.com>2021-03-01 13:39:37 -0800
commit0080ac2f632c5cf97b59a1694695f32043e0867d (patch)
treed6149a59be0a4322e28bdf3901769ee65c13fcc2
parentbb53f8a16340463913d91a0769db2524409431b6 (diff)
parente76d98406c256845a48ef3cd67e1e579df4750ca (diff)
downloadchef-0080ac2f632c5cf97b59a1694695f32043e0867d.tar.gz
Merge pull request #11123 from chef/fix_PR_subs
Signed-off-by: Tim Smith <tsmith@chef.io>
-rwxr-xr-x[-rw-r--r--].expeditor/update_dep.sh13
1 files changed, 8 insertions, 5 deletions
diff --git a/.expeditor/update_dep.sh b/.expeditor/update_dep.sh
index baf950c408..932c3dbbea 100644..100755
--- a/.expeditor/update_dep.sh
+++ b/.expeditor/update_dep.sh
@@ -11,11 +11,14 @@
set -evx
+REPONAME=$(echo $EXPEDITOR_REPO | cut -d '/' -f 2)
+DEPNAME="${EXPEDITOR_GEM_NAME:-${REPONAME:?Could not find gem name}}"
+
function new_gem_included() {
- git diff | grep -E '^\+' | grep "${EXPEDITOR_GEM_NAME} (${EXPEDITOR_VERSION})"
+ git diff | grep -E '^\+' | grep "${DEPNAME} (${EXPEDITOR_VERSION})"
}
-branch="expeditor/${EXPEDITOR_GEM_NAME}_${EXPEDITOR_VERSION}"
+branch="expeditor/${DEPNAME}_${EXPEDITOR_VERSION}"
git checkout -b "$branch"
tries=12
@@ -23,10 +26,10 @@ for (( i=1; i<=$tries; i+=1 )); do
bundle lock --update
new_gem_included && break || sleep 20
if [ $i -eq $tries ]; then
- echo "Searching for '${EXPEDITOR_GEM_NAME} (${EXPEDITOR_VERSION})' ${i} times and did not find it"
+ echo "Searching for '${DEPNAME} (${EXPEDITOR_VERSION})' ${i} times and did not find it"
exit 1
else
- echo "Searched ${i} times for '${EXPEDITOR_GEM_NAME} (${EXPEDITOR_VERSION})'"
+ echo "Searched ${i} times for '${DEPNAME} (${EXPEDITOR_VERSION})'"
fi
done
@@ -34,7 +37,7 @@ git add .
# give a friendly message for the commit and make sure it's noted for any future audit of our codebase that no
# DCO sign-off is needed for this sort of PR since it contains no intellectual property
-git commit --message "Bump $EXPEDITOR_GEM_NAME to $EXPEDITOR_VERSION" --message "This pull request was triggered automatically via Expeditor when $EXPEDITOR_GEM_NAME $EXPEDITOR_VERSION was promoted to Rubygems." --message "This change falls under the obvious fix policy so no Developer Certificate of Origin (DCO) sign-off is required."
+git commit --message "Bump $DEPNAME to $EXPEDITOR_VERSION" --message "This pull request was triggered automatically via Expeditor when $DEPNAME $EXPEDITOR_VERSION was promoted to Rubygems." --message "This change falls under the obvious fix policy so no Developer Certificate of Origin (DCO) sign-off is required."
open_pull_request "$EXPEDITOR_BRANCH"