@@ -56,19 +56,31 @@ jobs:
5656 echo ${CCACHE_BASEDIR}
5757 ccache -s
5858 fi
59+
60+ - name : Sanitize artifact name
61+ id : sanitize
62+ # This step removes special characters from the artifact name to ensure compatibility with upload-artifact
63+ # Characters removed: " : < > | * ? \r \n \ /
64+ # Spaces are replaced with underscores
65+ # This sanitization prevents errors in artifact creation and retrieval
66+ shell : pwsh
67+ run : |
68+ $originalName = "SofaMJEDFEM_${{ steps.sofa.outputs.run_branch }}_for-SOFA-${{ steps.sofa.outputs.sofa_version }}_${{ runner.os }}"
69+ $artifact_name = $originalName -replace '[":;<>|*?\r\n\\/]', '' -replace ' ', '_'
70+ echo "artifact_name=$artifact_name" >> $env:GITHUB_OUTPUT
71+
5972 - name : Create artifact
60- uses : actions/upload-artifact@v2
73+ uses : actions/upload-artifact@v4.4.0
6174 with :
62- name : SofaMJEDFEM_ ${{ steps.sofa .outputs.run_branch }}_for-SOFA-${{ steps.sofa.outputs.sofa_version }}_${{ runner.os }}
75+ name : ${{ steps.sanitize .outputs.artifact_name }}
6376 path : ${{ env.WORKSPACE_INSTALL_PATH }}
6477
6578 - name : Install artifact
66- uses : actions/download-artifact@v2
79+ uses : actions/download-artifact@v4.1.7
6780 with :
68- name : SofaMJEDFEM_ ${{ steps.sofa .outputs.run_branch }}_for-SOFA-${{ steps.sofa.outputs.sofa_version }}_${{ runner.os }}
81+ name : ${{ steps.sanitize .outputs.artifact_name }}
6982 path : ${{ env.WORKSPACE_ARTIFACT_PATH }}
7083
71-
7284 deploy :
7385 name : Deploy artifacts
7486 if : always() && startsWith(github.ref, 'refs/heads/') # we are on a branch (not a PR)
7789 continue-on-error : true
7890 steps :
7991 - name : Get artifacts
80- uses : actions/download-artifact@v2
92+ uses : actions/download-artifact@v4.1.7
8193 with :
8294 path : artifacts
8395
0 commit comments