Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] actions/upload-artifact/merge@v4: when files have the same name, the older one prevails #658

Open
marcodicro-dp opened this issue Dec 19, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@marcodicro-dp
Copy link

What happened?

  1. I have this upload-artifact steps in a matrix:
      - name: Upload xUnit report artifact
        if: ${{ !cancelled() }} # Upload artifact regardless of failures
        uses: actions/upload-artifact@v4
        with:
          name: shard-${{ matrix.shard }}-${{ github.run_id }}-test-results
          path: 'test/*_test_results.xml'
  1. And then I have this merge artifacts step:
      - name: Merge test results
        uses: actions/upload-artifact/merge@v4
        with:
          name: ${{ github.run_id }}-test-results
          pattern: '*${{ github.run_id }}-test-results'
          delete-merged: true

The issue happens in a re-run failed case. E.g. shard 1 and 2 failed in the first attempt, but they pass on re-run.

  1. New shard artifacts are generated
  2. Then the merge finds the following artifacts:
    • 123456-tests-results -> contains: 1_test_results.xml (with failure), 2_test_results.xml (with failure), 3_test_results.xml
    • shard-1-123456-test-results -> contains 1_test_results.xml (tests passed)
    • shard-2-123456-test-results -> contains 2_test_results.xml (tests passed)

Resulting merged artifact is:
123456-tests-results -> contains: 1_test_results.xml (with failure), 2_test_results.xml (with failure), 3_test_results.xml-> Same as before the merge

What did you expect to happen?

We expected the newer files from shard-1-123456-test-results and shard-2-123456-test-results to be chosen instead. With the passing tests results.

How can we reproduce it?

As stated above

Anything else we need to know?

No response

What version of the action are you using?

v4.5.0

What are your runner environments?

linux

Are you on GitHub Enterprise Server? If so, what version?

No

@marcodicro-dp marcodicro-dp added the bug Something isn't working label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant