Skip to content

Commit

Permalink
CI: Make version finding more flexible
Browse files Browse the repository at this point in the history
Use repository name rather than hard-coding MetPy, which allows this
action to be re-used in Siphon. Also print out the value since this is
often needed in debugging.
  • Loading branch information
dopplershift committed Oct 31, 2024
1 parent bb4aaac commit 9c5ff01
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/actions/build-docs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ runs:
- name: Set doc version
id: docversion
shell: bash -l {0}
run: echo "doc_version=$(python -c 'import metpy,re; print(re.search(r"(\d+\.\d+)", metpy.__version__)[0])')" >> $GITHUB_OUTPUT
run: echo "doc_version=$(python -c 'import importlib.metadata,os,re; print(re.search(r"(\d+\.\d+)", importlib.metadata.distribution(os.environ["GITHUB_REPOSITORY"].split("/")[-1].lower()).version)[0])')" >> $GITHUB_OUTPUT

- name: Show doc version
shell: bash -l {0}
run: echo Building docs for version ${{ steps.docversion.outputs.doc_version }}

- name: Build docs
shell: bash -l {0}
Expand Down

0 comments on commit 9c5ff01

Please sign in to comment.