From e8d768660424ae3e0e74a865cf43dbe30f9c7e0d Mon Sep 17 00:00:00 2001 From: Marko Kungla Date: Tue, 30 Jan 2024 00:05:04 +0200 Subject: [PATCH] fix: standardize 'Prepare flag name' step for cross-platform compatibility Signed-off-by: Marko Kungla --- .github/workflows/monorepo-main.yml | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/.github/workflows/monorepo-main.yml b/.github/workflows/monorepo-main.yml index 4accf2c..8c0631b 100644 --- a/.github/workflows/monorepo-main.yml +++ b/.github/workflows/monorepo-main.yml @@ -70,27 +70,22 @@ jobs: fi shell: bash - - name: Prepare flag name (Windows) - if: runner.os == 'Windows' + - name: Prepare flag name + id: prepare-flag run: | - $module_name = "./internal/cmd/hap" - $clean_module_name = $module_name.TrimStart('./') # Remove leading ./ - if ($clean_module_name -eq ".") { $clean_module_name = "happy" } - echo "clean_module_name=$clean_module_name" | Out-File -Append -FilePath $Env:GITHUB_OUTPUT - shell: pwsh - - - name: Prepare flag name (Linux and macOS) - if: runner.os != 'Windows' - run: | - module_name="./internal/cmd/hap" - clean_module_name="${module_name#./}" # Remove leading ./ - if [[ "$clean_module_name" == "." ]]; then + module_path="${{ matrix.module }}" + if [ "$module_path" == "." ]; then + # If the module path is the root, rename it to 'happy' clean_module_name="happy" + else + # Otherwise, use the module path as is, removing the leading './' + clean_module_name="${module_path#./}" fi echo "clean_module_name=$clean_module_name" >> $GITHUB_OUTPUT shell: bash + - name: Upload coverage if: steps.check-coverage.outputs.coverage_data_exists == 'true' uses: coverallsapp/github-action@v2