Skip to content

Commit

Permalink
Different default value approach
Browse files Browse the repository at this point in the history
  • Loading branch information
TomWerner committed Jan 5, 2025
1 parent 5c7a45a commit ac56bcc
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions .github/workflows/composite/buildSetup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,10 @@ description: "Performs cross-platform build setup"
runs:
using: "composite"
steps:
- name: Set is_debug_build
id: is_debug_build
# Determine if this is a debug build, defaulting to true if
# the github inputs aren't present, as is the case for
# automatically triggered runs.
# See https://dev.to/mrmike/github-action-handling-input-default-value-5f2g.
run: |
INPUT_IS_DEBUG_BUILD=${{ github.event.inputs.debug-build }}
echo "::set-output is_debug_build=value::${INPUT_IS_DEBUG_BUILD:-"true"}"
- name: Set folder_suffix
id: folder_suffix
# Like above, but for the folder suffix input.
run: |
INPUT_FOLDER_SUFFIX=${{ github.event.inputs.folder-suffix }}
echo "::set-output folder_suffix=value::${INPUT_FOLDER_SUFFIX:-"automatic_build"}"
- name: Optionally set BUILD_SUFFIX
shell: bash
run: |
if [[ ${{ steps.is_debug_build.outputs.value }} == 'true' ]]; then
if [[ ${{ github.event.inputs.debug-build || 'true' }} == 'true' ]]; then
echo "BUILD_SUFFIX=-debug" >> $GITHUB_ENV
else
echo "BUILD_SUFFIX=-release" >> $GITHUB_ENV
Expand Down Expand Up @@ -50,7 +35,7 @@ runs:
- name: Set FOLDER_NAME
shell: bash
run: |
echo "FOLDER_NAME=${EXPORT_NAME}${{ steps.folder_suffix.outputs.value }}${GH_USERNAME}${BUILD_TIME}" >> $GITHUB_ENV
echo "FOLDER_NAME=${EXPORT_NAME}${{ github.event.inputs.folder-suffix || 'automated_build' }}${GH_USERNAME}${BUILD_TIME}" >> $GITHUB_ENV
- name: Setup
shell: bash
run: |
Expand Down

0 comments on commit ac56bcc

Please sign in to comment.