Skip to content

fix (project): readme #10

fix (project): readme

fix (project): readme #10

name: "Check project version"
on:
pull_request:
branches:
- main
jobs:
version-check:
name: "Check project version doesn't already exists."
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- id: parse
name: "Extract version number from .version-data.json file."
run: |
# Parse .version-data.json file and extract the version
DSFR_VERSION=$(cat ./.version-data.json | jq .version)
# Send the version to the output
echo "dsfr-project-version=$DSFR_VERSION" >> $GITHUB_OUTPUT
- id: version-check
name: "Check if a tag matching the version doesn't already exists."
run: |
# Get the version from the previous step
VERSION=${{ steps.parse.outputs.dsfr-project-version }}
if git rev-parse "$VERSION" >/dev/null 2>&1; then
echo "A tag aleady exists for this version, please update the .version-data.json file to a new version.";
exit 1;
fi