From 326080b17c04ffdf42e7b0df5cad732f090e6bcd Mon Sep 17 00:00:00 2001 From: Leo Antoli <430982+lantoli@users.noreply.github.com> Date: Wed, 16 Oct 2024 15:25:07 +0200 Subject: [PATCH] set vars correctly --- .github/workflows/autoupdate-prod.yaml | 7 +++++-- tools/releaser/scripts/breaking-changes.sh | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/autoupdate-prod.yaml b/.github/workflows/autoupdate-prod.yaml index 9f6772bab..6d178a16a 100644 --- a/.github/workflows/autoupdate-prod.yaml +++ b/.github/workflows/autoupdate-prod.yaml @@ -25,7 +25,8 @@ jobs: git config --global user.name "github-actions[bot]" git add . git commit --allow-empty -m "fix: update OpenAPI spec" - - run: echo "API_DIFF_OLD_COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV + - name: Set old commit for SDK API diff + run: echo "API_DIFF_OLD_COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV - name: Run generation working-directory: ./tools run: | @@ -44,7 +45,9 @@ jobs: if: steps.verify-changed-files.outputs.files_changed == 'true' run: | git add . && git commit -m "fix: Generated SDK source code and docs" - - run: echo "API_DIFF_NEW_COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV + - name: Set new commit for SDK API diff + if: steps.verify-changed-files.outputs.files_changed == 'true' + run: echo "API_DIFF_NEW_COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV - name: Release updates if: steps.verify-changed-files.outputs.files_changed == 'true' working-directory: ./tools diff --git a/tools/releaser/scripts/breaking-changes.sh b/tools/releaser/scripts/breaking-changes.sh index a5f9837ee..6e9c53e66 100755 --- a/tools/releaser/scripts/breaking-changes.sh +++ b/tools/releaser/scripts/breaking-changes.sh @@ -12,7 +12,7 @@ script_path=$(dirname "$0") echo "Installing go-apidiff" go install github.com/joelanford/go-apidiff@latest > /dev/null -echo "Running breaking changes check for $GIT_BASE_REF" +echo "Running breaking changes check comparing commits ${API_DIFF_OLD_COMMIT} and ${API_DIFF_NEW_COMMIT}" pushd "$script_path/../../../" || exit ## workaround for --repo-path="../" not working echo "Changed directory to $(pwd)"