From 6650a4db76d168f8d37d6769e45409d4653db4e3 Mon Sep 17 00:00:00 2001 From: Stacky McStackface Date: Thu, 27 Nov 2025 09:15:57 +0000 Subject: [PATCH] chore: Generated commit to update templated files since the last template run up to stackabletech/operator-templating@e2b1da546527fc94e600d5db2fcccb7214c29ef3 Reference-to: stackabletech/operator-templating@e2b1da5 (Fix operator version extraction) --- .github/workflows/build.yaml | 18 ++++++++++++++---- renovate.json | 2 +- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 148289b..5a74fc4 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -103,23 +103,33 @@ jobs: - name: Update/Extract Operator Version id: version - if: github.event_name == 'pull_request' env: PR_BASE_REF: ${{ github.event.pull_request.base.ref }} PR_NUMBER: ${{ github.event.pull_request.number }} + GITHUB_EVENT_NAME: ${{ github.event_name }} GITHUB_DEBUG: ${{ runner.debug }} shell: bash run: | set -euo pipefail [ -n "$GITHUB_DEBUG" ] && set -x + CURRENT_VERSION=$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[0].version') - if [ "$PR_BASE_REF" == 'main' ]; then - NEW_VERSION="0.0.0-pr$PR_NUMBER" + + if [ "$GITHUB_EVENT_NAME" == 'pull_request' ]; then + # Include a PR suffix if this workflow is triggered by a PR + if [ "$PR_BASE_REF" == 'main' ]; then + NEW_VERSION="0.0.0-pr$PR_NUMBER" + else + NEW_VERSION="$CURRENT_VERSION-pr$PR_NUMBER" + fi else - NEW_VERSION="$CURRENT_VERSION-pr$PR_NUMBER" + # Just use the current version if this workflow is run on push, schedule, etc... + NEW_VERSION="$CURRENT_VERSION" fi + sed -i "s/version = \"${CURRENT_VERSION}\"/version = \"${NEW_VERSION}\"/" Cargo.toml echo "OPERATOR_VERSION=$NEW_VERSION" | tee -a "$GITHUB_OUTPUT" + - name: Install Nix uses: cachix/install-nix-action@fc6e360bedc9ee72d75e701397f0bb30dce77568 # v31.5.2 diff --git a/renovate.json b/renovate.json index 2e0c612..7af8ce9 100644 --- a/renovate.json +++ b/renovate.json @@ -3,5 +3,5 @@ "extends": [ "local>stackabletech/.github:renovate-config" ], - "ignorePaths": [".github/workflows/build.yaml", ".github/workflows/build.yml", ".github/workflows/general_daily_security.yml", ".github/workflows/integration-test.yml", ".github/workflows/pr_pre-commit.yaml"] + "ignorePaths": [".github/workflows/build.yaml", ".github/workflows/general_daily_security.yml", ".github/workflows/integration-test.yml", ".github/workflows/pr_pre-commit.yaml"] }