From 11cfc13d2d24bb36997a9b339902d7de28cbfdb0 Mon Sep 17 00:00:00 2001 From: Florian Ruppel Date: Mon, 8 Jun 2026 16:39:54 +0200 Subject: [PATCH 1/4] fix: check gh status for next version --- .github/workflows/test.yml | 29 +++++++++++++++++++++++++++++ setup-extension/action.yml | 8 ++++++++ versions/print_versions.bash | 6 +++++- 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 81c37f2..f92ed51 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,7 @@ name: Test actions on: pull_request: + workflow_dispatch: jobs: shopware-version-fallback: @@ -84,4 +85,32 @@ jobs: if [[ "${SHOPWARE_VERSION}" != "${EXPECTED_VERSION}" ]]; then echo "shopware-version should be '${EXPECTED_VERSION}' but got '${SHOPWARE_VERSION}'" exit 1 + fi + + print-versions: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout code + uses: actions/checkout@v6 + - name: Get versions + id: versions + uses: ./versions + env: + GH_TOKEN: ${{ github.token }} + - name: Print outputs + run: | + echo "next-minor: ${{ steps.versions.outputs.next-minor }}" + echo "next-patch: ${{ steps.versions.outputs.next-patch }}" + echo "latest: ${{ steps.versions.outputs.latest-version }}" + echo "first: ${{ steps.versions.outputs.first-version }}" + echo "lts-latest: ${{ steps.versions.outputs.lts-latest-version }}" + echo "lts-next-patch: ${{ steps.versions.outputs.lts-next-patch }}" + - name: Sanity-check next-minor + run: | + NEXT_MINOR="${{ steps.versions.outputs.next-minor }}" + if [[ ! "$NEXT_MINOR" =~ ^v?[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "next-minor looks wrong: '${NEXT_MINOR}'" + exit 1 fi \ No newline at end of file diff --git a/setup-extension/action.yml b/setup-extension/action.yml index a40b3cf..75900e7 100644 --- a/setup-extension/action.yml +++ b/setup-extension/action.yml @@ -142,6 +142,14 @@ runs: allow-insecure-versions: ${{ inputs.allow-insecure-versions }} env: ${{ inputs.env }} + - name: Install symfony-cli + shell: bash + run: | + if ! command -v symfony &> /dev/null; then + curl -1sLf 'https://dl.cloudsmith.io/public/symfony/stable/setup.deb.sh' | sudo -E bash + sudo apt-get install -y symfony-cli + fi + - name: Clone Extension if: ${{ ! inputs.extension-zip }} uses: actions/checkout@v6 diff --git a/versions/print_versions.bash b/versions/print_versions.bash index 59fa304..7a4b0b4 100755 --- a/versions/print_versions.bash +++ b/versions/print_versions.bash @@ -26,7 +26,11 @@ get_next_minor_and_patch() { IFS='.' read -r -a parts <<<"${max_tag}" local next_release_branch="${parts[0]#v}.${parts[1]}.$((${parts[2]} + 1)).x" - if gh api "repos/shopware/shopware/branches/${next_release_branch}" --silent 2>/dev/null; then + local gh_output gh_status + gh_output=$(gh api "repos/shopware/shopware/branches/${next_release_branch}" 2>&1) + gh_status=$? + if [ $gh_status -eq 0 ] || ! echo "$gh_output" | grep -q "HTTP 404"; then + # Branch exists, or the API call failed for an unknown reason — default to freeze. echo "NEXT_MINOR=${parts[0]}.${parts[1]}.$((${parts[2]} + 2)).0" else echo "NEXT_MINOR=${parts[0]}.${parts[1]}.$((${parts[2]} + 1)).0" From a0f94e0c5ad1c38a5fc43803977e18f4b90b515b Mon Sep 17 00:00:00 2001 From: Florian Ruppel Date: Mon, 8 Jun 2026 16:47:43 +0200 Subject: [PATCH 2/4] ci: add auth check --- .github/workflows/test.yml | 2 -- versions/action.yml | 4 ++++ versions/print_versions.bash | 5 +++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f92ed51..7827edd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -97,8 +97,6 @@ jobs: - name: Get versions id: versions uses: ./versions - env: - GH_TOKEN: ${{ github.token }} - name: Print outputs run: | echo "next-minor: ${{ steps.versions.outputs.next-minor }}" diff --git a/versions/action.yml b/versions/action.yml index 41dd0b2..20c18c7 100644 --- a/versions/action.yml +++ b/versions/action.yml @@ -12,6 +12,9 @@ inputs: lts-major: description: LTS major prefix like v6.5. default: v6.6. + github-token: + description: Token used to check for release branches via the GitHub API + default: ${{ github.token }} outputs: first-version: @@ -47,5 +50,6 @@ runs: env: CUR_MAJOR: ${{ inputs.major }} PREV_MAJOR: ${{ inputs.lts-major }} + GH_TOKEN: ${{ inputs.github-token }} run: | ${GITHUB_ACTION_PATH}/print_versions.bash | tee >> "$GITHUB_OUTPUT" diff --git a/versions/print_versions.bash b/versions/print_versions.bash index 7a4b0b4..3c0ebda 100755 --- a/versions/print_versions.bash +++ b/versions/print_versions.bash @@ -1,5 +1,10 @@ #!/usr/bin/env bash +if ! gh auth status &>/dev/null; then + echo "::error::gh is not authenticated. Set GH_TOKEN or GITHUB_TOKEN." >&2 + exit 1 +fi + PREV_MAJOR="${PREV_MAJOR:-"v6.6."}" CUR_MAJOR="${CUR_MAJOR:-"v6.7."}" From b6c1f2017a6ebce3eafc25afb719c17d7e96dbd3 Mon Sep 17 00:00:00 2001 From: Florian Ruppel Date: Mon, 8 Jun 2026 16:51:57 +0200 Subject: [PATCH 3/4] fix: add token to test workflow --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7827edd..02202af 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -97,6 +97,8 @@ jobs: - name: Get versions id: versions uses: ./versions + with: + github-token: ${{ github.token }} - name: Print outputs run: | echo "next-minor: ${{ steps.versions.outputs.next-minor }}" From 886d4cb723ad5bf64102fa09a1647a01696da804 Mon Sep 17 00:00:00 2001 From: Florian Ruppel Date: Mon, 8 Jun 2026 16:58:29 +0200 Subject: [PATCH 4/4] chore: revert change --- setup-extension/action.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/setup-extension/action.yml b/setup-extension/action.yml index 75900e7..a40b3cf 100644 --- a/setup-extension/action.yml +++ b/setup-extension/action.yml @@ -142,14 +142,6 @@ runs: allow-insecure-versions: ${{ inputs.allow-insecure-versions }} env: ${{ inputs.env }} - - name: Install symfony-cli - shell: bash - run: | - if ! command -v symfony &> /dev/null; then - curl -1sLf 'https://dl.cloudsmith.io/public/symfony/stable/setup.deb.sh' | sudo -E bash - sudo apt-get install -y symfony-cli - fi - - name: Clone Extension if: ${{ ! inputs.extension-zip }} uses: actions/checkout@v6