Skip to content

Commit

Permalink
fix: standardize 'Prepare flag name' step for cross-platform compatib…
Browse files Browse the repository at this point in the history
…ility

Signed-off-by: Marko Kungla <[email protected]>
  • Loading branch information
mkungla committed Jan 29, 2024
1 parent 8993d7a commit e8d7686
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions .github/workflows/monorepo-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e8d7686

Please sign in to comment.