mirror of
https://github.com/graycoreio/github-actions-magento2.git
synced 2026-06-08 19:46:41 +00:00
test(get-magento-version): document and pin what happens in various kinds of installs
This commit is contained in:
@@ -22,22 +22,7 @@ runs:
|
||||
- name: Compute Installed Magento version
|
||||
id: get-magento-version
|
||||
shell: bash
|
||||
working-directory: ${{ inputs.working-directory }}
|
||||
run: |
|
||||
PATTERN="magento/product-(community|enterprise)-edition|mage-os/product-community-edition"
|
||||
|
||||
if [ -f composer.lock ]; then
|
||||
RESULT=$(jq -r --arg p "$PATTERN" '.packages[] | select(.name | test($p)) | "\(.name) \(.version)"' composer.lock | head -1)
|
||||
else
|
||||
RESULT=$(jq -r --arg p "$PATTERN" '.require | to_entries[] | select(.key | test($p)) | "\(.key) \(.value)"' composer.json | head -1)
|
||||
fi
|
||||
|
||||
PRODUCT=$(echo "$RESULT" | awk '{print $1}')
|
||||
VERSION=$(echo "$RESULT" | awk '{print $2}' | sed 's/^v//')
|
||||
PROJECT=$(echo "$PRODUCT" | sed 's/product-/project-/')
|
||||
|
||||
echo "version=\"$VERSION\"" >> $GITHUB_OUTPUT
|
||||
echo "project=$PROJECT" >> $GITHUB_OUTPUT
|
||||
run: bash "${{ github.action_path }}/get-magento-version.sh" "${{ inputs.working-directory }}" >> $GITHUB_OUTPUT
|
||||
|
||||
branding:
|
||||
icon: "code"
|
||||
|
||||
Reference in New Issue
Block a user