From fe3bfae77a9bbf252951895b26f50f0d10e7bb88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20Kr=C3=A4ml?= Date: Wed, 3 Jun 2026 10:42:20 +0200 Subject: [PATCH] fix: export GH_TOKEN and sanitize REPO --- setup-extension/action.yml | 4 +++- shopware-version/shopware-version.bash | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/setup-extension/action.yml b/setup-extension/action.yml index 3f8b810..a40b3cf 100644 --- a/setup-extension/action.yml +++ b/setup-extension/action.yml @@ -217,6 +217,7 @@ runs: if [ -n "${dep_token}" ]; then # if a custom token is provided use this token to clone git config --global "http.${dep_repo}/.extraheader" "AUTHORIZATION: basic $(echo -n "x-access-token:${dep_token}" | base64)" + export GH_TOKEN="${dep_token}" fi git clone "$dep_repo" "custom/plugins/$dep_name" @@ -224,13 +225,14 @@ runs: if [ -n "${dep_branch}" ]; then if [ "${dep_branch}" = ".auto" ]; then echo "" >"$GITHUB_OUTPUT" - REPO="$(echo "${dep_repo}")" GH_TOKEN="$(echo "${dep_token}")" "${GITHUB_ACTION_PATH}/../shopware-version/shopware-version.bash" + REPO="$(echo "${dep_repo}")" "${GITHUB_ACTION_PATH}/../shopware-version/shopware-version.bash" dep_branch=$(cat "$GITHUB_OUTPUT" | grep "^shopware-version=" | cut -d'=' -f2) fi if [ "${dep_branch}" != "trunk" ]; then git -C custom/plugins/${dep_name} checkout ${dep_branch} fi fi + unset GH_TOKEN done - name: Install dependencies with Composer diff --git a/shopware-version/shopware-version.bash b/shopware-version/shopware-version.bash index a91415c..e795039 100755 --- a/shopware-version/shopware-version.bash +++ b/shopware-version/shopware-version.bash @@ -54,6 +54,7 @@ echo "base ref: ${BASE_REF}" # Normalize REPO to owner/repo format for gh api REPO="${REPO#"https://github.com/"}" +REPO="${REPO%.git}" ref_exists() { local branch="${1#"refs/heads/"}" @@ -122,4 +123,3 @@ fi echo "Matching shopware version: $version" echo "shopware-version=$version" >>"$GITHUB_OUTPUT" -