Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions downstream/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ runs:
"upstream": {
"id": "${{ github.run_id }}",
"ref": "${{ github.head_ref || github.ref }}",
"base_ref": "${{ github.base_ref }}",
"repo": "${{ github.repository }}",
"github-token": "${{ github.token }}",
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
Expand Down
3 changes: 2 additions & 1 deletion setup-extension/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ runs:
DEPS: ${{ inputs.dependencies }}
REF: ${{ inputs.shopwareVersion }}
HEAD_REF: ${{ github.head_ref }}
BASE_REF: ${{ github.base_ref }}
# if base ref is not set we run in downstream and use the current ref as fallback
BASE_REF: ${{ github.base_ref || github.ref }}
FALLBACK: ${{ inputs.shopwareVersionFallback }}
run: |
for dep in $(echo "$DEPS" | envsubst | jq -c '.[]'); do
Expand Down
15 changes: 10 additions & 5 deletions shopware-version/shopware-version.bash
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,22 @@ else
version="${remote_ref#"refs/heads/"}"
echo "✓ Found matching next major: ${version}"
else
echo "✗ No matching branch found, using fallback: ${FALLBACK}"
# Use fallback
version="${FALLBACK}"
echo "✗ No matching branch found, checking fallback: ${FALLBACK}"

fallback_ref=$(git ls-remote --heads "${REPO}" "${FALLBACK}" | cut -f 2)
if [[ -n "${fallback_ref}" ]]; then
# Use fallback
version="${FALLBACK}"
echo "✓ Found matching fallback: ${FALLBACK}"
fi
fi
fi
fi
fi

if [[ -z "$version" ]]; then
echo "$REF not found in ${REPO}, using fallback "
version="${FALLBACK}"
echo "$REF not found in ${REPO}, using hard-coded fallback = trunk"
version="trunk"
fi

echo "Matching shopware version: $version"
Expand Down