@@ -58,17 +58,28 @@ jobs:
5858 echo ${CCACHE_BASEDIR}
5959 ccache -s
6060 fi
61+ - name : Sanitize artifact name
62+ id : sanitize
63+ # This step removes special characters from the artifact name to ensure compatibility with upload-artifact
64+ # Characters removed: " : < > | * ? \r \n \ /
65+ # Spaces are replaced with underscores
66+ # This sanitization prevents errors in artifact creation and retrieval
67+ shell : pwsh
68+ run : |
69+ $originalName = "SofaSphFluid_${{ steps.sofa.outputs.run_branch }}_for-SOFA-${{ steps.sofa.outputs.sofa_version }}_${{ runner.os }}"
70+ $artifact_name = $originalName -replace '[":;<>|*?\r\n\\/]', '' -replace ' ', '_'
71+ echo "artifact_name=$artifact_name" >> $env:GITHUB_OUTPUT
6172
6273 - name : Create artifact
63- uses : actions/upload-artifact@v2
74+ uses : actions/upload-artifact@v4.4.0
6475 with :
65- name : SofaSphFluid_ ${{ steps.sofa .outputs.run_branch }}_for-SOFA-${{ steps.sofa.outputs.sofa_version }}_${{ runner.os }}
76+ name : ${{ steps.sanitize .outputs.artifact_name }}
6677 path : ${{ env.WORKSPACE_INSTALL_PATH }}
6778
6879 - name : Install artifact
69- uses : actions/download-artifact@v2
80+ uses : actions/download-artifact@v4.1.7
7081 with :
71- name : SofaSphFluid_ ${{ steps.sofa .outputs.run_branch }}_for-SOFA-${{ steps.sofa.outputs.sofa_version }}_${{ runner.os }}
82+ name : ${{ steps.sanitize .outputs.artifact_name }}
7283 path : ${{ env.WORKSPACE_ARTIFACT_PATH }}
7384
7485 - name : Set env vars for tests
@@ -120,7 +131,7 @@ jobs:
120131 continue-on-error : true
121132 steps :
122133 - name : Get artifacts
123- uses : actions/download-artifact@v2
134+ uses : actions/download-artifact@v4.1.7
124135 with :
125136 path : artifacts
126137
0 commit comments