Skip to content

[bug] Fails to overwrite existing artifact when archive is false #769

@kazutoiris

Description

@kazutoiris

What happened?

When configuring the action with archive: false and overwrite: true, the action fails to correctly delete the existing artifact before uploading the new one.

Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run

What did you expect to happen?

When archive: false, the artifact name is derived from the file's name. The name parameter should be completely ignored during the deletion phases.

How can we reproduce it?

name: Test

on:
  workflow_dispatch:

jobs:
  test1:
    name: Test 1
    runs-on: ubuntu-latest
    steps:
      - name: Run
        run: |
          echo "123" > 1.txt

      - name: Upload Artifact
        uses: actions/upload-artifact@v7
        with:
          archive: false
          overwrite: true
          path: 1.txt

  test2:
    name: Test 2
    needs: test1
    runs-on: ubuntu-latest
    steps:
      - name: Run
        run: |
          echo "456" > 1.txt

      - name: Upload Artifact
        uses: actions/upload-artifact@v7
        with:
          archive: false
          overwrite: true
          path: 1.txt

Or in kazutoiris/NW.js-Build/actions/runs/22487854021

Anything else we need to know?

No response

What version of the action are you using?

v7

What are your runner environments?

linux

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

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions