> For the complete documentation index, see [llms.txt](https://docs.currents.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.currents.dev/getting-started/ci-setup/github-actions/re-run-failed-only-tests.md).

# Re-run Only Failed Tests

How to set up failed test re-runs on GitHub Actions

When a workflow fails in GitHub Actions, the failed jobs can be re-run. However, Playwright needs extra setup to re-run only the failed tests.

For GitHub Actions, Currents provides the [Last Failed GitHub Action](https://github.com/currents-dev/playwright-last-failed) to simplify re-runs with Playwright sharding or Currents Orchestration.

{% hint style="info" %}
The `playwright-last-failed` action uses `@currents/cmd` as a dependency. To control which version of `@currents/cmd` is used, install it as a dev dependency in `package.json` and use `npm ci` (or your package manager's equivalent frozen lockfile install) in GitHub Actions. Without this, the action installs `@currents/cmd` globally from npm, which may pull a different version than what's pinned in your lockfile.
{% endhint %}

Select the guide that matches your setup:

* [Sharded runs](/getting-started/ci-setup/github-actions/re-run-failed-only-tests/re-run-failed-only-tests-sharded.md) - fixed shard count and native Playwright `--shard` parallelism
* [Orchestrated runs](/getting-started/ci-setup/github-actions/re-run-failed-only-tests/re-run-failed-only-tests-orchestrated-v2.md) - `pwc-p discover` and `pwc-p run`
* [Custom CI Build ID for Re-runs](/getting-started/ci-setup/github-actions/re-run-failed-only-tests/custom-ci-build-id-for-reruns.md) - for sharded or orchestrated runs with a non-default CI build ID


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.currents.dev/getting-started/ci-setup/github-actions/re-run-failed-only-tests.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
