From 07debd66c24fd136ac632ad5074d3481b0ebb731 Mon Sep 17 00:00:00 2001 From: Bruno Date: Tue, 28 May 2024 11:52:00 -0300 Subject: [PATCH] Ephemeral instances: fetch the grafana version from the package.json file (#88300) --- .github/workflows/ephemeral-instances-pr-comment.yml | 9 ++++++++- .../workflows/ephemeral-instances-pr-opened-closed.yml | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ephemeral-instances-pr-comment.yml b/.github/workflows/ephemeral-instances-pr-comment.yml index b6b3a5b4c42..22175d820d0 100644 --- a/.github/workflows/ephemeral-instances-pr-comment.yml +++ b/.github/workflows/ephemeral-instances-pr-comment.yml @@ -57,11 +57,18 @@ jobs: ref: main path: ephemeral + - name: Get latest grafana version number + run: | + # if package.json contains e.g. 11.0.0-pre, this writes 11.0.0 to version.txt + curl https://raw.githubusercontent.com/grafana/grafana/main/package.json | jq -r .version | grep -o '^[0-9\.]*' > version.txt + - name: Run action env: GITHUB_EVENT: ${{ toJson(github.event)}} run: | - GRAFANA_VERSION=10.1.0 + # Create a prerelease version number using the latest version from the package.json in the grafana repo. + export GRAFANA_VERSION="$(cat version.txt)" + echo "${GRAFANA_VERSION}" cd $GITHUB_WORKSPACE/ephemeral/src go run . \ diff --git a/.github/workflows/ephemeral-instances-pr-opened-closed.yml b/.github/workflows/ephemeral-instances-pr-opened-closed.yml index 594bbddbc41..96c67156f9c 100644 --- a/.github/workflows/ephemeral-instances-pr-opened-closed.yml +++ b/.github/workflows/ephemeral-instances-pr-opened-closed.yml @@ -49,11 +49,18 @@ jobs: ref: main path: ephemeral + - name: Get latest grafana version number + run: | + # if package.json contains e.g. 11.0.0-pre, this writes 11.0.0 to version.txt + curl https://raw.githubusercontent.com/grafana/grafana/main/package.json | jq -r .version | grep -o '^[0-9\.]*' > version.txt + - name: Run action env: GITHUB_EVENT: ${{ toJson(github.event)}} run: | - GRAFANA_VERSION=10.1.0 + # Create a prerelease version number using the latest version from the package.json in the grafana repo. + export GRAFANA_VERSION="$(cat version.txt)" + echo "${GRAFANA_VERSION}" cd $GITHUB_WORKSPACE/ephemeral/src go run . \