Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions shopware-version/shopware-version.bash
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ get_ref() {

PR_NR=$(echo "${REF}" | sed -E -n "s|^refs/heads/gh-readonly-queue/[^/]+/pr-([0-9]+)-.*$|\1|p")
if [[ -n "${PR_NR}" ]]; then
echo "refs/heads/$(gh pr view --repo "${CURRENT_REPO}" "${PR_NR}" --jq '.headRefName' --json headRefName)"
echo "refs/heads/$(gh pr view --repo "${CURRENT_REPO}" "${PR_NR}" --jq '.headRefName' --json headRefName)"
return
fi

#remove whitespace from HEAD_REF with bash substitution
Expand All @@ -33,7 +34,8 @@ get_ref() {
get_base_ref() {
PR_NR=$(echo "${1}" | sed -E -n "s|^refs/heads/gh-readonly-queue/[^/]+/pr-([0-9]+)-.*$|\1|p")
if [[ -n "${PR_NR}" ]]; then
echo "$(gh pr view --repo "${CURRENT_REPO}" "${PR_NR}" --jq '.baseRefName' --json baseRefName)"
echo "$(gh pr view --repo "${CURRENT_REPO}" "${PR_NR}" --jq '.baseRefName' --json baseRefName)"
return
fi

#remove whitespace from BASE_REF with bash substitution
Expand Down Expand Up @@ -63,7 +65,6 @@ fi
# to get the next minor from a patch branch replace last part with x
# to get the next major from a patch branch replace last two parts with x


echo "Step 1: Checking if REF '${REF}' exists in target repo '${REPO}'"
remote_ref=$(git ls-remote --heads "${REPO}" "${REF}" | cut -f 2)
if [[ -n "${remote_ref}" ]]; then
Expand Down Expand Up @@ -117,4 +118,5 @@ fi

echo "Matching shopware version: $version"

echo "shopware-version=$version" >> "$GITHUB_OUTPUT"
echo "shopware-version=$version" >>"$GITHUB_OUTPUT"