Skip to content

Commit afcef65

Browse files
committed
[ci] Sanitize the github workflow
1 parent 2ecacde commit afcef65

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,29 @@ jobs:
5454
echo ${CCACHE_BASEDIR}
5555
ccache -s
5656
fi
57+
58+
- name: Sanitize artifact name
59+
id: sanitize
60+
# This step removes special characters from the artifact name to ensure compatibility with upload-artifact
61+
# Characters removed: " : < > | * ? \r \n \ /
62+
# Spaces are replaced with underscores
63+
# This sanitization prevents errors in artifact creation and retrieval
64+
shell: pwsh
65+
run: |
66+
$originalName = "InfinyToolkit_${{ steps.sofa.outputs.run_branch }}_for-SOFA-${{ steps.sofa.outputs.sofa_version }}_${{ runner.os }}"
67+
$artifact_name = $originalName -replace '[":;<>|*?\r\n\\/]', '' -replace ' ', '_'
68+
echo "artifact_name=$artifact_name" >> $env:GITHUB_OUTPUT
69+
5770
- name: Create artifact
58-
uses: actions/upload-artifact@v2
71+
uses: actions/upload-artifact@v4.4.0
5972
with:
60-
name: Tearing_${{ steps.sofa.outputs.run_branch }}_for-SOFA-${{ steps.sofa.outputs.sofa_version }}_${{ runner.os }}
73+
name: ${{ steps.sanitize.outputs.artifact_name }}
6174
path: ${{ env.WORKSPACE_INSTALL_PATH }}
6275

6376
- name: Install artifact
64-
uses: actions/download-artifact@v2
77+
uses: actions/download-artifact@v4.1.7
6578
with:
66-
name: Tearing_${{ steps.sofa.outputs.run_branch }}_for-SOFA-${{ steps.sofa.outputs.sofa_version }}_${{ runner.os }}
79+
name: ${{ steps.sanitize.outputs.artifact_name }}
6780
path: ${{ env.WORKSPACE_ARTIFACT_PATH }}
6881

6982
- name: Set env vars for tests
@@ -88,7 +101,7 @@ jobs:
88101
continue-on-error: true
89102
steps:
90103
- name: Get artifacts
91-
uses: actions/download-artifact@v2
104+
uses: actions/download-artifact@v4.1.7
92105
with:
93106
path: artifacts
94107

0 commit comments

Comments
 (0)