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