diff --git a/.gitignore b/.gitignore index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..f1742047d0e895a0075f80827f567fd48e128e32 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/.ahoy.l3d diff --git a/bin/merge b/bin/merge index fa07528c5f96fa00f3b966ffc2526ad2804dd9a6..99a6520b6469434e6e200404cce62ffb6a414e6e 100755 --- a/bin/merge +++ b/bin/merge @@ -71,14 +71,18 @@ if [[ "$host1" != "$host2" ]]; then exit 4 fi -echo "Find project ID from remote URL ..." -# shellcheck disable=SC2001 -path="$(echo "$path" | sed -e 's,\..*,,g')" -gitlab 200 GET projects?search="$path" -PRJID=$(echo "$result" | jq -r .[0]."id") -if [[ $(isNumeric "$PRJID") -eq 1 ]]; then - echo "Can not find project ID" - exit 5 +if [[ -n ${CI_PROJECT_ID} ]]; then + PRJID=$CI_PROJECT_ID +else + echo "Find project ID from remote URL ..." + # shellcheck disable=SC2001 + path="$(echo "$path" | sed -e 's,\..*,,g')" + gitlab 200 GET projects?search="$path" + PRJID=$(echo "$result" | jq -r .[0]."id") + if [[ $(isNumeric "$PRJID") -eq 1 ]]; then + echo "Can not find project ID" + exit 5 + fi fi echo "Create merge request ..."