Skip to content

Commit ebcdfa0

Browse files
committed
ci: add version check to release
1 parent b8e3a38 commit ebcdfa0

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

.github/workflows/release-image.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,29 @@ concurrency:
1515
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
1616

1717
jobs:
18+
checkout-version-check:
19+
name: checkout & version check
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Version check
28+
run: |
29+
GIT_VERSION=${GITHUB_REF%-*}
30+
PYTHON_VERSION=$(grep -m 1 version pyproject.toml | grep -e '\d.\d.\d' -o)
31+
if [[ "$GIT_VERSION" == "$PYTHON_VERSION" ]]; then
32+
echo "PYTHON_VERSION: $PYTHON_VERSION and GIT_VERSION: $GIT_VERSION are matched"
33+
echo "Version check passed"
34+
else
35+
echo "Version check failed, PYTHON_VERSION: $PYTHON_VERSION and GIT_VERSION: $GIT_VERSION are mismatched"
36+
exit 1
37+
fi
1838
build-push:
1939
name: Build docker image - wfsrv
40+
needs: [checkout-version-check]
2041
uses: ./.github/workflows/reusable-docker-build-push.yaml
2142
permissions:
2243
contents: "read"

0 commit comments

Comments
 (0)