Skip to content

Commit c30d199

Browse files
committed
merge
2 parents da1833e + 6f74eb8 commit c30d199

2 files changed

Lines changed: 45 additions & 9 deletions

File tree

.github/workflows/base_schema.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,17 @@ jobs:
6666
done
6767
6868
for k in $(yq '. | keys | .[]' enhance.yml); do
69-
newData=$(yq ".\"${k}\"" enhance.yml);
69+
newData=$(yq -r ".\"${k}\"" enhance.yml);
7070
# escape all keys by default
7171
j=$(echo "$k" | sed -r 's/[.]+/"."/g')
7272
# remove first extra quote
7373
j=${j#*\"}
74-
# add one extra quote at the end
75-
yq -I 4 -o json -i "${j}\" = \"${newData}\"" adminapi.json
74+
# only apply enhancement if the target field exists in adminapi.json
75+
if yq -e "${j}\"" adminapi.json >/dev/null 2>&1; then
76+
yq -I 4 -o json -i "${j}\" = \"${newData}\"" adminapi.json
77+
else
78+
echo "Skip: ${k} (path: ${j}\") not found in adminapi.json"
79+
fi
7680
done
7781
7882
- name: Download original file

.github/workflows/manual_versioning.yml

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,31 +34,63 @@ on:
3434
default: true
3535

3636
jobs:
37+
guard:
38+
name: "Check version matches branch"
39+
runs-on: ubuntu-22.04
40+
outputs:
41+
proceed: ${{ steps.check.outputs.proceed }}
42+
steps:
43+
- id: check
44+
env:
45+
VERSION: ${{ inputs.shopware_version }}
46+
BRANCH: ${{ github.ref_name }}
47+
run: |
48+
# Map branch -> expected version pattern. Bump `latest` when it moves.
49+
case "$BRANCH" in
50+
latest) expected='^v?6\.7\.' ;;
51+
v6.6) expected='^v?6\.6\.' ;;
52+
main|trunk) expected='.*' ;;
53+
*) expected='.*' ;;
54+
esac
55+
56+
if [[ "$VERSION" =~ $expected ]]; then
57+
echo "proceed=true" >> "$GITHUB_OUTPUT"
58+
echo "::notice::Accepting $VERSION on branch $BRANCH"
59+
else
60+
echo "proceed=false" >> "$GITHUB_OUTPUT"
61+
echo "::notice::Skipping: $VERSION does not belong on branch $BRANCH"
62+
fi
63+
3764
generate-trunk:
38-
if: ${{ inputs.trigger_default_schema }}
65+
needs: guard
66+
if: ${{ needs.guard.outputs.proceed == 'true' && inputs.trigger_default_schema }}
3967
uses: ./.github/workflows/base_schema.yml
4068
with:
4169
shopware_version: ${{ inputs.shopware_version }}
4270
php_version: ${{ inputs.php_version }}
4371
secrets: inherit
44-
72+
4573
generate-commercial-trunk:
46-
if: ${{ inputs.trigger_commercial_schema }}
74+
needs: guard
75+
if: ${{ needs.guard.outputs.proceed == 'true' && inputs.trigger_commercial_schema }}
4776
uses: ./.github/workflows/plugin_commercial_schema.yml
4877
with:
4978
shopware_version: ${{ inputs.shopware_version }}
5079
php_version: ${{ inputs.php_version }}
5180
secrets: inherit
52-
81+
5382
generate-digitalsalesroom-trunk:
54-
if: ${{ inputs.trigger_digitalsalesroom_schema }}
83+
needs: guard
84+
if: ${{ needs.guard.outputs.proceed == 'true' && inputs.trigger_digitalsalesroom_schema }}
5585
uses: ./.github/workflows/plugin_digitalsalesroom_schema.yml
5686
with:
5787
shopware_version: ${{ inputs.shopware_version }}
5888
php_version: ${{ inputs.php_version }}
5989
secrets: inherit
90+
6091
generate-customproducts-trunk:
61-
if: ${{ inputs.trigger_customproducts_schema }}
92+
needs: guard
93+
if: ${{ needs.guard.outputs.proceed == 'true' && inputs.trigger_customproducts_schema }}
6294
uses: ./.github/workflows/plugin_customproducts_schema.yml
6395
with:
6496
shopware_version: ${{ inputs.shopware_version }}

0 commit comments

Comments
 (0)