From 40ad2d49c348bae4b59b83cd266031ad4906b5c1 Mon Sep 17 00:00:00 2001 From: Jimmi Dyson Date: Thu, 29 Jun 2023 11:19:03 +0100 Subject: [PATCH] ci: Update plugin.yaml with released version on release --- .github/workflows/release-tag.yaml | 20 ++++++++++++++++++++ plugin.yaml | 1 - 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-tag.yaml b/.github/workflows/release-tag.yaml index 2e7280d..b643caa 100644 --- a/.github/workflows/release-tag.yaml +++ b/.github/workflows/release-tag.yaml @@ -31,3 +31,23 @@ jobs: run: make release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Update released plugin version in plugin.yaml + run: yq -i -y '.version |= ("${{ github.ref }}" | sub("^v";""))' plugin.yaml + + # Use the REST API to update plugin.yaml, so we get automatic commit signing. + - name: Commit changes to plugin.yaml via REST API + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + FILE_TO_COMMIT: plugin.yaml + DESTINATION_BRANCH: main + run: | + export MESSAGE="build: Update plugin.yaml to version ${{ github.ref }}" + export SHA="$( git rev-parse ${DESTINATION_BRANCH}:${FILE_TO_COMMIT} )"" + export CONTENT="$( base64 -i ${FILE_TO_COMMIT} )" + gh api --method PUT /repos/:owner/:repo/contents/${FILE_TO_COMMIT} \ + --field message="${MESSAGE}" \ + --field content="${CONTENT}" \ + --field encoding="base64" \ + --field branch="${DESTINATION_BRANCH}" \ + --field sha="${SHA}" diff --git a/plugin.yaml b/plugin.yaml index 2f003cb..ab86b14 100644 --- a/plugin.yaml +++ b/plugin.yaml @@ -2,7 +2,6 @@ name: "list-images" version: "0.5.0" usage: "Lists all/selected docker images that are part of deployment" description: "Lists all/selected docker images that would be part of deployment of selected chart" -useTunnel: true command: "$HELM_PLUGIN_DIR/bin/helm-list-images" hooks: install: "$HELM_PLUGIN_DIR/install-binary.sh"