File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111 - " release*"
1212
1313jobs :
14- build :
14+ validate-version :
15+ runs-on : ubuntu-latest
16+ steps :
17+ - name : Checkout code
18+ uses : actions/checkout@v4
19+
20+ - name : Get Latest Release Version
21+ id : get_latest_release
22+ run : |
23+ LATEST_RELEASE=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r '.tag_name' | sed 's/^v//')
24+ echo "Latest release: $LATEST_RELEASE"
25+ echo "LATEST_RELEASE=${LATEST_RELEASE}" >> $GITHUB_ENV
1526
27+ - name : Validate DETECT_PROJECT_VERSION_NAME
28+ id : validate_version
29+ run : |
30+ LATEST_VERSION=${LATEST_RELEASE}
31+ CURRENT_VERSION=$(grep -oP 'DETECT_PROJECT_VERSION_NAME=\K.*' scripts/bd_scan.bash)
32+ echo "Latest version released: $LATEST_VERSION"
33+ echo "Current version for scanning: $CURRENT_VERSION"
34+ if [ "$(printf '%s\n' "$LATEST_VERSION" "$CURRENT_VERSION" | sort -V | tail -n 1)" == "$LATEST_VERSION" ]; then
35+ echo "Error: DETECT_PROJECT_VERSION_NAME ($CURRENT_VERSION) must be greater than the latest release version ($LATEST_VERSION) in bd_scan.sh script."
36+ exit 1
37+ fi
38+
39+ build :
40+ needs : validate-version
1641 runs-on : self-hosted
1742 steps :
1843 - uses : actions/setup-java@v4
You can’t perform that action at this time.
0 commit comments