Skip to content

Commit f2cd88b

Browse files
committed
fix: added projectsFolder config to fixing the location of the projects
1 parent 7ac01ae commit f2cd88b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

step/codecov/action.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ inputs:
2121
exclude-projects:
2222
description: "The projects to exclude when full upload should happen"
2323
required: false
24+
projectsFolder:
25+
description: "The folder where the projects are located"
26+
required: false
27+
default: "packages"
2428

2529
runs:
2630
using: "composite"
@@ -61,15 +65,15 @@ runs:
6165
if: "inputs.use-affected == 'true'"
6266
shell: "bash"
6367
run: |
64-
IFS=$'\n' read -r -d '' -a affected_projects < <(pnpm nx show projects --affected --files=${{ inputs.affected-files }} --exclude=${{ inputs.exclude-affected-projects }} && printf '\0')
68+
IFS=$'\n' read -r -d '' -a affected_projects < <(pnpm nx show projects --affected --projects "${{ inputs.projectsFolder }}/*" --files=${{ inputs.affected-files }} --exclude=${{ inputs.exclude-affected-projects }} && printf '\0')
6569
6670
# Remove the first two elements of the array, this include infos about the command call
6771
unset 'affected_projects[0]'
6872
unset 'affected_projects[1]'
6973
7074
for project in "${affected_projects[@]}"; do
7175
echo "Runing codecov in ${project} folder"
72-
./codecov --codecov-yml-path codecov.yml --verbose upload-process --fail-on-error --dir "packages/${project}" -t "${CODECOV_TOKEN}" -F "${project}" -n "${project}-${{ github.run_id }}"
76+
./codecov --codecov-yml-path codecov.yml --verbose upload-process --fail-on-error --dir "${{ inputs.projectsFolder }}/${project}" -t "${CODECOV_TOKEN}" -F "${project}" -n "${project}-${{ github.run_id }}"
7377
done
7478
env:
7579
CODECOV_TOKEN: "${{ inputs.codecov-token }}"
@@ -78,15 +82,15 @@ runs:
7882
if: "inputs.use-affected == 'false'"
7983
shell: "bash"
8084
run: |
81-
IFS=$'\n' read -r -d '' -a exclude_array < <(pnpm nx show projects --exclude=${{ inputs.exclude-projects }} && printf '\0')
85+
IFS=$'\n' read -r -d '' -a exclude_array < <(pnpm nx show projects --projects "${{ inputs.projectsFolder }}/*" --exclude=${{ inputs.exclude-projects }} && printf '\0')
8286
8387
# Remove the first two elements of the array, this include infos about the command call
8488
unset 'exclude_array[0]'
8589
unset 'exclude_array[1]'
8690
8791
for project in "${exclude_array[@]}"; do
8892
echo "Runing codecov in ${project} folder"
89-
./codecov --codecov-yml-path codecov.yml --verbose upload-process --fail-on-error --dir "packages/${project}" -t "${CODECOV_TOKEN}" -F "${project}" -n "${project}-${{ github.run_id }}"
93+
./codecov --codecov-yml-path codecov.yml --verbose upload-process --fail-on-error --dir "${{ inputs.projectsFolder }}/${project}" -t "${CODECOV_TOKEN}" -F "${project}" -n "${project}-${{ github.run_id }}"
9094
done
9195
env:
9296
CODECOV_TOKEN: "${{ inputs.codecov-token }}"

0 commit comments

Comments
 (0)