Skip to content

Commit 6b1d7eb

Browse files
committed
fail prep release if on CI to avoid inf loop
1 parent 1debd81 commit 6b1d7eb

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ jobs:
1717
runs-on: ubuntu-latest
1818
if: startsWith(github.ref, 'refs/heads/sdk-core/') # Only run on branches that start with sdk-core/
1919
env:
20-
VERSION: ${{ github.event.inputs.version }}
21-
BUILD_NUMBER: ${{ github.event.inputs.build_number }}
20+
SDK_VERSION: ${{ github.event.inputs.version }}
21+
SDK_BUILD_NUMBER: ${{ github.event.inputs.build_number }}
2222
steps:
2323
- name: Checkout the code
2424
uses: actions/checkout@v4
@@ -34,8 +34,9 @@ jobs:
3434
- name: Run the Prep Release Script
3535
env:
3636
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
SDK_CI: 1
3738
run: |
38-
make prep-release VERSION="{{ env.SDK_VERSION }}" BUILD_NUMBER="{{ env.SDK_BUILD_NUMBER }}"
39+
make prep-release VERSION=${{ env.SDK_VERSION }} BUILD_NUMBER=${{ env.SDK_BUILD_NUMBER }}
3940
shell: bash
4041

4142
build-wheels:

src/release/scripts/prep-release.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ update_and_validate_version() {
5050
echo "Invalid version number format: ${version}"
5151
echo "Please enter a version number in the 'x.y.z(-beta.w)' format."
5252
fi
53+
# If running in CI, exit immediately
54+
if [[ -n "${SDK_CI}" ]]; then
55+
exit 1
56+
fi
5357
done
5458
}
5559

@@ -73,6 +77,10 @@ update_and_validate_build() {
7377
echo "Invalid build number format: ${build}"
7478
echo "Please enter a build number in the 'Mmmppbb' format."
7579
fi
80+
# If running in CI, exit immediately
81+
if [[ -n "${SDK_CI}" ]]; then
82+
exit 1
83+
fi
7684
done
7785
}
7886

0 commit comments

Comments
 (0)