Skip to content

Commit

Permalink
Validate/normalise version number in set_version.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ajjackson committed Dec 12, 2024
1 parent d3827ae commit c813e0e
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/set_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,18 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Show input parameters
shell: bash -l {0}
run: |
echo "${{ inputs.ref }}"
echo "${{ inputs.version }}"
- name: Validate and normalise version number
shell: python
run : |
import os
from packaging.version import Version
version_string = 'v' + str(Version("${{ inputs.version }}"))
print(f"Normalised version string: {version_string}")
with open(os.environ["GITHUB_ENV"], "a") as github_env:
print(f"VERSION_STRING={version_string}", file=github_env)
- uses: actions/checkout@v4
with:
Expand Down

0 comments on commit c813e0e

Please sign in to comment.