Skip to content

Commit

Permalink
ci: fix error if release_directory is left empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Silverlan authored Nov 25, 2023
1 parent e605da6 commit cb4b0ce
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-linux-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Create Release Files
shell: bash
run: |
if [ -n "${{ steps.module-info.outputs.release_directory }}" ]; then
if [ "${{ steps.module-info.outputs.release_directory }}" != "DEFAULT" ]; then
mkdir -p "release/${{ steps.module-info.outputs.release_directory }}"
cp -a "${{ steps.build-module.outputs.install-dir }}/${{ steps.module-info.outputs.release_directory }}." "release/${{ steps.module-info.outputs.release_directory }}"
else
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-windows-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- name: Create Release Files
shell: bash
run: |
if [ -n "${{ steps.module-info.outputs.release_directory }}" ]; then
if [ "${{ steps.module-info.outputs.release_directory }}" != "DEFAULT" ]; then
mkdir -p "release/${{ steps.module-info.outputs.release_directory }}"
cp -a "${{ steps.build-module.outputs.install-dir }}/${{ steps.module-info.outputs.release_directory }}." "release/${{ steps.module-info.outputs.release_directory }}"
else
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
if: steps.template_exists.outputs.files_exists == 'true'
run: npx tmplr && rm -fr .tmplr.yml && rm -fr .github/workflows/init.yml
env:
# Note: The values must not be an empty string, due to a bug in the tmplr module
name: ${{ steps.module-info.outputs.name }}
module_name: ${{ steps.module-info.outputs.module_name }}
install_directory: ${{ steps.module-info.outputs.install_directory }}
Expand Down
4 changes: 4 additions & 0 deletions github_actions/get_module_info/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ runs:
module_name=$( getVal '.module_name' )
install_directory=$( getVal '.install_directory' )
release_directory=$( getVal '.release_directory' )
if [ -z "$release_directory" ]; then
# If release_directory is empty, assign the default value "DEFAULT"
release_directory="DEFAULT"
fi
echo "name=$name" >> $GITHUB_OUTPUT
echo "module_name=$module_name" >> $GITHUB_OUTPUT
Expand Down

0 comments on commit cb4b0ce

Please sign in to comment.