Add Cargo.toml Version validation to Forgejo Actions
All checks were successful
Run Tests on Code / run-tests (push) Successful in 1s
All checks were successful
Run Tests on Code / run-tests (push) Successful in 1s
This commit is contained in:
parent
955592ac41
commit
8683282182
1 changed files with 13 additions and 3 deletions
|
@ -10,9 +10,19 @@ jobs:
|
||||||
run-tests:
|
run-tests:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
steps:
|
steps:
|
||||||
-
|
- name: Checking Out Repository Code
|
||||||
name: Placeholder
|
uses: https://code.forgejo.org/actions/checkout@v3
|
||||||
run: echo Placeholder Job
|
- name: Placeholder
|
||||||
|
run: echo Placeholder Job
|
||||||
|
- name: Check if Version in Cargo.toml matches Tag
|
||||||
|
run: |
|
||||||
|
VERSION=$(cat src/Cargo.toml | grep -E "(^|\|)version =" | cut -f2- -d= | tr -d \" | tr -d " ")
|
||||||
|
if test $VERSION != "${{ github.ref_name }}"; then
|
||||||
|
echo "Expected Version is: '${{ github.ref_name }}' actual Version is: '$VERSION'";
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "Version is: '$VERSION'";
|
||||||
|
fi
|
||||||
|
|
||||||
build:
|
build:
|
||||||
needs: test
|
needs: test
|
||||||
|
|
Loading…
Reference in a new issue