Skip to content

Commit

Permalink
Normalize upload artifact name (#103)
Browse files Browse the repository at this point in the history
* Refs #21134: Normalize matrix name before uploading artifact

Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com>

* Refs #21134: Normalize name also when downloading the artifact

Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com>

---------

Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com>
  • Loading branch information
JesusPoderoso authored Jun 11, 2024
1 parent d11dfae commit bd4f914
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
12 changes: 11 additions & 1 deletion external/download-artifact/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,21 @@ runs:
using: composite
steps:

- name: Normalize artifact name
id: normalize
shell: bash
run: |
echo "::group::Normalize name"
normalized_name=$(echo "${{ inputs.name }}" | sed 's/["\\/:<>|*?"]/_/g')
echo "$normalized_name"
echo "normalized_name=$normalized_name" >> $GITHUB_ENV
echo "::endgroup::"
- name: Download artifacts
id: download_artifact
uses: actions/download-artifact@v4
with:
name: ${{ inputs.name }}
name: ${{ env.normalized_name }}
path: ${{ inputs.path }}
pattern: ${{ inputs.pattern }}
merge-multiple: ${{ inputs.merge-multiple }}
Expand Down
12 changes: 11 additions & 1 deletion external/upload-artifact/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,20 @@ runs:
using: composite
steps:

- name: Normalize artifact name
id: normalize
shell: bash
run: |
echo "::group::Normalize name"
normalized_name=$(echo "${{ inputs.name }}" | sed 's/["\\/:<>|*?"]/_/g')
echo "$normalized_name"
echo "normalized_name=$normalized_name" >> $GITHUB_ENV
echo "::endgroup::"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.name }}
name: ${{ env.normalized_name }}
path: ${{ inputs.path }}
if-no-files-found: ${{ inputs.if-no-files-found }}
retention-days: ${{ inputs.retention-days }}
3 changes: 3 additions & 0 deletions versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ The [Forthcoming](#forthcoming) section includes those features added in `main`

The upcoming release will include the following **features**:

- Fix upload artifact action to allow branch names in the name (by removing forbidden characters).
- Add previous method to download artifact action to ensure name consistency.

## v0.18.2

- Fix warning in `colcon_build_test` action
Expand Down

0 comments on commit bd4f914

Please sign in to comment.