actions / upload-artifact

MIT License
3.26k stars 739 forks source link

[feat req] Merge action should support `if-no-files-found` #520

Open comp615 opened 9 months ago

comp615 commented 9 months ago

What would you like to be added?

Please add the same behavior of if-no-files-found from the main action to the merge action

Why is this needed?

Many matrixed workflows conditionally generate artifacts (i.e. Cypress videos or snapshots). The previous pattern in v3 was to simply upload artifact and set if-no-files-found: ignore. If there's artifacts, great...if not, no problem.

Given that the solution to accomplish the same task in v4 is to use the merge action. There should be a matching param so that in the event all the matrixed tests pass without issue, the merge job doesn't fail.

Try It

      - name: Merge Artifacts
        uses: comp615/upload-artifact/merge@merge_not_found
        with:
          name: cypress-videos
          pattern: cypress-videos-*
          delete-merged: true
          if-no-files-found: ignore