Skip to content

Commit

Permalink
Fix logic for checking documentation framework
Browse files Browse the repository at this point in the history
  • Loading branch information
CasperWA committed May 18, 2023
1 parent 5987a04 commit c8ebff5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/cd_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,11 @@ jobs:
steps:
- name: Check input
run: |
if [[ "${{ inputs.docs_framework }}" != "mkdocs" || "${{ inputs.docs_framework }}" != "sphinx" ]]; then
echo "The input 'docs_framework' must be either 'mkdocs' or 'sphinx' !"
echo "Found value: ${{ inputs.docs_framework }}"
exit 1
valid_frameworks=("mkdocs sphinx")
if [[ ! " ${valid_frameworks[*]} " =~ " ${{ inputs.docs_framework}} " ]]; then
echo "The input '${{ inputs.docs_framework}}' is not supported."
echo "Valid inputs are: ${valid_frameworks[*]}"
exit 1
fi
- name: Checkout ${{ github.repository }}
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/ci_cd_updated_default_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,11 @@ jobs:
steps:
- name: Check input
run: |
if [[ "${{ inputs.docs_framework }}" != "mkdocs" || "${{ inputs.docs_framework }}" != "sphinx" ]]; then
echo "The input 'docs_framework' must be either 'mkdocs' or 'sphinx' !"
echo "Found value: ${{ inputs.docs_framework }}"
exit 1
valid_frameworks=("mkdocs sphinx")
if [[ ! " ${valid_frameworks[*]} " =~ " ${{ inputs.docs_framework}} " ]]; then
echo "The input '${{ inputs.docs_framework}}' is not supported."
echo "Valid inputs are: ${valid_frameworks[*]}"
exit 1
fi
- name: Release check
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,11 @@ jobs:
("${{ inputs.use_mkdocs }}" == "false" && "${{ inputs.use_sphinx }}" == "false") || \
("${{ inputs.use_mkdocs }}" == "true" && "${{ inputs.use_sphinx }}" == "false") ]]; then
# (Default to) using MkDocs
echo "Framework determined: MkDocs"
echo "framework=mkdocs" >> $GITHUB_ENV
elif [[ "${{ inputs.use_mkdocs }}" == "false" && "${{ inputs.use_sphinx }}" == "true" ]]; then
# Use Sphinx
echo "Framework determined: Sphinx"
echo "framework=sphinx" >> $GITHUB_ENV
else
echo "Could not determine what documentation framework to use."
Expand Down

0 comments on commit c8ebff5

Please sign in to comment.