From b031e01c8467be0162d1c69b4fa01761555e5b8e Mon Sep 17 00:00:00 2001 From: juicer Date: Thu, 2 Jan 2025 21:13:22 -0800 Subject: [PATCH] add job to get fluent-bit version from file Signed-off-by: juicer --- .github/workflows/build-fb-image.yaml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-fb-image.yaml b/.github/workflows/build-fb-image.yaml index bb3f40463..0d482954a 100644 --- a/.github/workflows/build-fb-image.yaml +++ b/.github/workflows/build-fb-image.yaml @@ -2,11 +2,6 @@ name: Building Fluent Bit image on: workflow_dispatch: - inputs: - docker_tag_version: - description: 'Fluent Bit image release version' - required: true - default: '3.1.8' env: DOCKER_REPO: 'kubesphere' @@ -18,6 +13,19 @@ permissions: packages: write jobs: + get-version: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Read fluent-bit version from file + id: get-version + run: | + VERSION=$(cat cmd/fluent-watcher/fluentbit/VERSION) # Read the version from the VERSION file + echo "version=${VERSION}" >> $GITHUB_ENV # Set the version as an environment variable + echo "::set-output name=version::${VERSION}" # Set the output for the step + determine-tags: runs-on: ubuntu-latest name: Determine image tags @@ -29,7 +37,7 @@ jobs: - name: Determine image version tag id: determine-tags run: | - VERSION=${{ github.event.inputs.docker_tag_version }} + VERSION=${{ steps.get-version.outputs.version }} VERSION_WITHOUT_V=${VERSION#v} MAJOR_MINOR=$(echo $VERSION_WITHOUT_V | cut -d. -f1-2)