Skip to content

Commit

Permalink
Fix undefined case for set_final_tag input as false
Browse files Browse the repository at this point in the history
  • Loading branch information
cofinoa committed Dec 2, 2024
1 parent 3d0bdb4 commit 352099f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/build_and_deploy_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,16 @@ jobs:
cd gh-pages
# Ensure .nojekyll exists
[ ! -f .nojekyll ] && touch .nojekyll
FINAL_TAG_INPUT="${{ github.event.inputs.set_final_tag || 'false' }}"
EVENT_NAME="${{ github.event_name }}"
# Determine target directory based on the event type
if [[ ${{ github.event_name }} == 'workflow_dispatch' && ${{ github.event.inputs.set_final_tag }} == 'true' ]]; then
if [[ "$EVENT_NAME" == "workflow_dispatch" && "$FINAL_TAG_INPUT" == "true" ]]; then
echo "TARGET_DIR=final-preview/${GITHUB_REF_NAME}" >> $GITHUB_ENV
elif [[ ${{ github.event_name }} == 'release' ]]; then
elif [[ "$EVENT_NAME" == 'release' ]]; then
echo "TARGET_DIR=release/${GITHUB_REF_NAME}" >> $GITHUB_ENV
elif [[ ${{ github.event_name }} == 'pull_request' ]]; then
elif [[ "$EVENT_NAME" == 'pull_request' ]]; then
PR_NUMBER=${{ github.event.pull_request.number }}
echo "TARGET_DIR=pr-preview/${PR_NUMBER}" >> $GITHUB_ENV
elif [[ ${{ github.ref_name }} == '${{ github.event.repository.default_branch }}' ]]; then
Expand Down

0 comments on commit 352099f

Please sign in to comment.