# Fix "deprecated version of actions/upload-artifact: v3" Workflow Failures

Yes. An agent moves upload-artifact and download-artifact to v4 together, checks every artifact name is unique per run, and opens a pull request with the reasoning.

[Run this on Rush](https://cloud.getrush.ai/run/fix-upload-artifact-v3-deprecation/github-actions/). Opens the console with this prompt ready to send, in a Project that has your repository.

## What the agent does

The agent maps every upload to its downloads before bumping a version, because v4 is not a drop-in. Since January 30, 2025 GitHub fails any job that uses v3 of the artifact actions, and v4 changed the rule that workflows leaned on most: an artifact can no longer be uploaded to twice under one name. In a project like whalebrew/whalebrew, `.github/workflows/go.yml` builds in a matrix of five jobs, Ubuntu for `amd64`, `arm` and `arm64` and macOS for `amd64` and `arm64`, and each job runs two `actions/upload-artifact@v3` steps. `release.yaml` calls that workflow and then runs `actions/download-artifact@v3` with only a `path`, which fetches everything into `release/artifacts`.

It checks the first upload for name collisions and finds none. The name comes from the `binary` step, `whalebrew-` plus the output of `uname -s` plus the architecture, with `amd64` mapped to `x86_64`. Across the matrix that gives five distinct names, from `whalebrew-Linux-x86_64` to `whalebrew-Darwin-arm64`. Under v4 each job creates its own artifact and nothing clashes.

The second upload is where reading pays off. It uploads `CHANGELOG.md` under the fixed name `CHANGELOG.md`, guarded by `if: ${{ matrix.os }} == 'ubuntu-latest' && ${{ matrix.arch }} == 'amd64'`. That guard does not do what it says. With text outside the `${{ }}` markers the whole line is a non-empty string, and actionlint reports it as always evaluated to true. So all five jobs upload an artifact with the same name. Under v3 that was harmless, since repeated uploads merged into one artifact. Under v4 the second job to arrive is refused, unless the step sets `overwrite: true`, which deletes the existing artifact and creates a new one. This step already sets it. A bare version bump could therefore pass, with five jobs deleting and recreating each other's changelog in whatever order they finish.

The agent fixes the cause: it rewrites the guard as one expression, `matrix.os == 'ubuntu-latest' && matrix.arch == 'amd64'`, so one job uploads the file, and removes `overwrite`. Then it moves the download to v4 in the same pull request, because v4 of the download action does not read artifacts that v3 uploaded. It keeps `merge-multiple` off. The release job copies `release/artifacts/CHANGELOG.md/CHANGELOG.md`, a path that only exists when each artifact lands in a directory named after it, and the local `actions/release` step walks the folder recursively, so the per-artifact layout suits both.

## Start it with one API call

`POST https://api.phoenix.so/o/{org}/sessions`

```json
{
  "agent": "claude",
  "input": "Our workflows fail with: This request has been automatically failed because it uses a deprecated version of `actions/upload-artifact: v3`. Migrate every use of actions/upload-artifact and actions/download-artifact to v4, in workflows, reusable workflows and local composite actions, in one change. First list every upload step with its file, job, matrix, name expression, path and if condition, and every download step with its name, pattern and path and what later steps do with the downloaded files. For each upload inside a matrix or called from more than one job, work out the set of names it produces across all jobs and say whether any two jobs produce the same name; evaluate if conditions exactly as GitHub does, including conditions with text outside ${{ }}, and run actionlint if you can install it. Where names collide, make them unique or make one job upload, and prefer fixing the cause over adding overwrite: true. If a download step relied on v3 merging same-named uploads, use pattern and merge-multiple on the download, or the upload-artifact/merge action, and show the directory layout later steps will see. Check for paths that start with a dot, since v4 skips hidden files unless include-hidden-files is set. Keep retention and compression settings. Do not change what is built. State clearly that you cannot run hosted runners, and say which workflow run will prove each change. List other deprecated actions you notice as follow-ups. Open a pull request with the upload and download tables and the name sets.",
  "resources": [
    {
      "url": "https://github.com/your-org/your-app"
    }
  ]
}
```

1. **Get an API key.** In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
2. **Send the request.** POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
3. **Read what came back.** Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.

## What comes back

A pull request that edits `go.yml` and `release.yaml`: three `@v3` references become `@v4`, the `if` on the changelog upload becomes a real expression, and `overwrite: true` goes away. The description carries two tables. The upload table lists each step with the names it produces across the five matrix jobs. The download table shows the directory tree the release job will find under `release/artifacts`: five binary directories and one `CHANGELOG.md` directory, the same shape the `cp` line expects.

It explains the changelog finding in its own section, quoting the linter's message, because it changes behaviour on purpose. Before, five jobs uploaded the file and the result depended on timing. After, the Ubuntu `amd64` job uploads it once. The description also names what the agent could not do, which is run the workflows. The push and pull request triggers on `go.yml` mean the pull request's own checks exercise both uploads. The download runs only in `release.yaml` on a manual dispatch with a tag, so the description asks for a draft release to prove it.

A reviewer reads the name sets first. If any two jobs can still produce the same name, the v4 upload will fail on the second, and that is visible in the table before any run. The follow-up list is short and separate: the `set-output` command in the `binary` step, and a coverage upload action the linter marks as too old to run.

## Run it on every workflow run that fails on a v3 artifact action

This failure is immediate and total: the job is failed before the step does any work. Add an automation with a `github` trigger on `workflow_run.failure` to the Project that holds the repository, with the prompt above. The failed run's event is placed after the prompt. The agent then searches the workflow files for `@v3` artifact actions itself, and if it finds none it reports that the failure has another cause and changes nothing.

A `github` trigger fires only for work by a repository owner, member or collaborator, and never for CI runs from forks. For repositories that build rarely, such as ones that only release on tags, do not wait for a failure: search for `upload-artifact@v3` and `download-artifact@v3` across your organisation and start one run per repository through the API, each with a `request_id` that is a UUID v5 of the repository name.

## Why run it on Rush?

Dependency bots open the version bump for this on their own, and it is the wrong unit of work. The bump is three characters. The migration is the question of which jobs write which names and who reads them afterwards, and answering it means evaluating matrix expansions and `if` conditions the way the runner does. In the whalebrew example the bump alone could pass its checks and leave a race in the release path. The agent does the evaluation in its own sandbox and writes the name sets into the pull request, where a reviewer can check them without running anything.

Workflows are also hard to test from a laptop, so people test them by pushing and waiting. A run that reasons the layout through first, lints the files, and says exactly which workflow run will prove which change shortens that loop to one push. The session transcript keeps the linter output and the search results that the tables were built from.

## Frequently asked questions

### What breaks when moving from v3 to v4?

Mainly naming. In v4 an artifact is immutable, so several jobs can no longer upload to one name, and matrix jobs need a name that includes a matrix value. Hidden files are skipped by default in current v4 releases. The upload and download actions must move together, since v4 of one does not work with v3 of the other.

### I used one artifact name so the download got everything in one folder. How do I keep that?

Give each upload a unique name with a shared prefix, then download with `pattern: prefix-*` and `merge-multiple: true`, which places the files from every matching artifact into one directory. If files in different artifacts share a name, the last one written wins. The `actions/upload-artifact/merge` action can instead combine them into a single artifact.

### Is overwrite: true a reasonable fix for the name conflict?

It is right when one job replaces its own earlier upload. It is a poor fit for parallel jobs, because each one deletes whatever the previous job stored and the survivor is decided by timing. The agent uses it only where the workflow really means to replace an artifact, and otherwise makes the names unique.

### Why is my if condition always true?

An `if` that mixes `${{ }}` markers with other text is evaluated as a string, and a non-empty string is true. Write the whole condition as one expression, either with no markers or with one pair around all of it. actionlint flags this pattern, and the agent checks every condition on an upload step for it.

### Does this apply to GitHub Enterprise Server?

GitHub's deprecation notice says it does not affect existing GitHub Enterprise Server versions. The agent reads the `runs-on` labels and any enterprise URLs in the workflows, and if the repository appears to run on a server installation it reports that and leaves the workflows as they are.

## More GitHub Actions jobs

- [Migrate a GitHub Action from Jest to Vitest](https://getrush.ai/run/migrate-jest-to-vitest/github-actions/)
- [Pin GitHub Actions to Commit SHAs in Your Workflows](https://getrush.ai/run/pin-action-versions/github-actions/)
- [Review GitHub Actions Workflow Changes](https://getrush.ai/run/review-workflow-changes/github-actions/)

## More jobs like this: Fix a bug from an alert

- [Fix `undefined method 'escape' for module URI` (NoMethodError) on Ruby 3](https://getrush.ai/run/fix-uri-escape-nomethoderror/uri/)
- [Fix "[DEP0169] DeprecationWarning: url.parse() behavior is not standardized"](https://getrush.ai/run/fix-url-parse-deprecation-warning/nodejs/)
- [Fix "Retry.__init__() got an unexpected keyword argument 'method_whitelist'"](https://getrush.ai/run/fix-urllib3-method-whitelist-error/urllib3/)

## Keep reading

- [How a Rush run works on your repository, from request to pull request](https://getrush.ai/cloud/)
- [Compare cloud agents, agent sandboxes and AI code review](https://getrush.ai/compare/)
- [Rush pricing: Free, Pro and Max](https://getrush.ai/pricing/)
