From 2d791a888651f546d135a4ae3932bd6f0210c427 Mon Sep 17 00:00:00 2001 From: "privilegedescalation-engineer[bot]" <269729446+privilegedescalation-engineer[bot]@users.noreply.github.com> Date: Mon, 4 May 2026 05:37:55 +0000 Subject: [PATCH] fix(plugin-release): strip @scope and / from PKG_NAME for tarball matching (#124) headlamp-plugin package strips the @ scope prefix and replaces / with - when naming tarballs (e.g. @privilegedescalation/headlamp-argocd-plugin becomes privilegedescalation-headlamp-argocd-plugin). The workflow was using the raw package.json name without this transformation, causing the Prepare release tarball step to fail when it couldn't find the expected tarball file. Co-authored-by: Chris Farhood --- .github/workflows/plugin-release.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/plugin-release.yaml b/.github/workflows/plugin-release.yaml index 785d02f..7ace5c1 100644 --- a/.github/workflows/plugin-release.yaml +++ b/.github/workflows/plugin-release.yaml @@ -208,7 +208,7 @@ jobs: - name: Update artifacthub-pkg.yml run: | VERSION="${{ inputs.version }}" - PKG_NAME=$(jq -r .name package.json) + PKG_NAME=$(jq -r .name package.json | sed 's|^@||' | tr '/' '-') RELEASE_URL="https://github.com/${{ github.repository }}/releases/download/v${VERSION}/${PKG_NAME}-${VERSION}.tar.gz" sed -i "s/^version:.*/version: \"${VERSION}\"/" artifacthub-pkg.yml sed -i "s|headlamp/plugin/archive-url:.*|headlamp/plugin/archive-url: \"${RELEASE_URL}\"|" artifacthub-pkg.yml @@ -241,9 +241,10 @@ jobs: - name: Prepare release tarball run: | VERSION="${{ inputs.version }}" - PKG_NAME=$(jq -r .name package.json) + # headlamp-plugin strips the @ scope prefix and replaces / with - when naming tarballs. + # e.g. @privilegedescalation/headlamp-argocd-plugin -> privilegedescalation-headlamp-argocd-plugin + PKG_NAME=$(jq -r .name package.json | sed 's|^@||' | tr '/' '-') TARBALL="${PKG_NAME}-${VERSION}.tar.gz" - # Rename tarball if headlamp-plugin produced a different name for f in *.tar.gz; do [ "$f" != "$TARBALL" ] && mv "$f" "$TARBALL" done