|
34 | 34 | default: true |
35 | 35 |
|
36 | 36 | 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 | +
|
37 | 64 | generate-trunk: |
38 | | - if: ${{ inputs.trigger_default_schema }} |
| 65 | + needs: guard |
| 66 | + if: ${{ needs.guard.outputs.proceed == 'true' && inputs.trigger_default_schema }} |
39 | 67 | uses: ./.github/workflows/base_schema.yml |
40 | 68 | with: |
41 | 69 | shopware_version: ${{ inputs.shopware_version }} |
42 | 70 | php_version: ${{ inputs.php_version }} |
43 | 71 | secrets: inherit |
44 | | - |
| 72 | + |
45 | 73 | generate-commercial-trunk: |
46 | | - if: ${{ inputs.trigger_commercial_schema }} |
| 74 | + needs: guard |
| 75 | + if: ${{ needs.guard.outputs.proceed == 'true' && inputs.trigger_commercial_schema }} |
47 | 76 | uses: ./.github/workflows/plugin_commercial_schema.yml |
48 | 77 | with: |
49 | 78 | shopware_version: ${{ inputs.shopware_version }} |
50 | 79 | php_version: ${{ inputs.php_version }} |
51 | 80 | secrets: inherit |
52 | | - |
| 81 | + |
53 | 82 | generate-digitalsalesroom-trunk: |
54 | | - if: ${{ inputs.trigger_digitalsalesroom_schema }} |
| 83 | + needs: guard |
| 84 | + if: ${{ needs.guard.outputs.proceed == 'true' && inputs.trigger_digitalsalesroom_schema }} |
55 | 85 | uses: ./.github/workflows/plugin_digitalsalesroom_schema.yml |
56 | 86 | with: |
57 | 87 | shopware_version: ${{ inputs.shopware_version }} |
58 | 88 | php_version: ${{ inputs.php_version }} |
59 | 89 | secrets: inherit |
| 90 | + |
60 | 91 | generate-customproducts-trunk: |
61 | | - if: ${{ inputs.trigger_customproducts_schema }} |
| 92 | + needs: guard |
| 93 | + if: ${{ needs.guard.outputs.proceed == 'true' && inputs.trigger_customproducts_schema }} |
62 | 94 | uses: ./.github/workflows/plugin_customproducts_schema.yml |
63 | 95 | with: |
64 | 96 | shopware_version: ${{ inputs.shopware_version }} |
|
0 commit comments