Without any inputs, the above would merge the three my-artifact-* actions into merged-artifact. There are of course multiple options to adjust the behavior and refine, e.g.
merge:
runs-on: ubuntu-latest
needs: upload
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4
with:
# the name of the merged artifact
into: my-merged-artifact
# the pattern to match artifacts to merge
pattern: my-artifact-*
# whether or not to place the artifacts into separate directories
separate-directories: false
# to delete the artifacts after merging
delete-merged: true
# retention days, same as the upload action
retention-days: 90
# compression level, same as the upload action
compression-level: 9
This PR does change a lot to the structure of the repo, so I'll probably split it into two to make it easier to review:
Moving the upload logic into it's own directory + unit tests
Reorganizing and adding sub-action to "merge" artifacts.
For the simplest use-case, it would look something like:
Without any inputs, the above would merge the three
my-artifact-*
actions intomerged-artifact
. There are of course multiple options to adjust the behavior and refine, e.g.This PR does change a lot to the structure of the repo, so I'll probably split it into two to make it easier to review:
upload
logic into it's own directory + unit testsmerge
sub-action, docs + unit testsHere's an example run: https://github.com/robherley/tmp-merge-artifacts/actions/runs/7586676926