<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/test-github-actions-locally-with-act-xikwrgbox" -->

---
title: Test GitHub Actions Locally with Act | daily.dev
description: GitHub Actions workflows are notoriously hard to test because a workflow typically must exist on the main branch or use specific triggers before it can be...
canonical: https://daily.dev/posts/test-github-actions-locally-with-act-xikwrgbox
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Test GitHub Actions Locally with Act | daily.dev
og:description: GitHub Actions workflows are notoriously hard to test because a workflow typically must exist on the main branch or use specific triggers before it can be...
og:url: https://daily.dev/posts/test-github-actions-locally-with-act-xikwrgbox
og:image: https://api.daily.dev/og/posts/xikWrgBOx.png
og:image:alt: Test GitHub Actions Locally with Act
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Test GitHub Actions Locally with Act

**[Atomic Spin](https://daily.dev/sources/atomicobject)** · 4 min read · 0 upvotes · 0 comments

## Summary

GitHub Actions workflows are notoriously hard to test because a workflow typically must exist on the main branch or use specific triggers before it can be exercised in the Actions suite. The nektos/act tool solves this by running GitHub Actions workflows locally using Docker, pulling images that replicate GitHub's environment variables and file system setup. A practical example shows using act to verify a pull_request-triggered unit test workflow builds correctly with the right Node and Linux container versions before merging. Getting started requires installing Docker and act, then running commands like 'act -l' to list workflows and 'act pull-request' to trigger a specific workflow event locally.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://spin.atomicobject.com/test-github-actions-locally-act>

## Questions this post answers

### How can I test a GitHub Actions workflow locally before merging my pull request?

Use act, an open-source tool from the nektos/act repository, to run GitHub Actions workflows locally through Docker. Act pulls Docker images that replicate GitHub's environment variables and file system setup, letting you trigger events like pull_request without merging code. Install Docker and act, then run 'act -l' to list workflows and 'act pull-request' to run a specific trigger.

_daily.dev surfaces practical CI/CD tooling like this for developers refining their GitHub Actions testing workflow._

### Why can't I test a new GitHub Actions workflow just by opening a pull request?

GitHub Actions only pulls workflows from the main branch, so a workflow added in an open pull request often cannot be triggered or tested until it's merged. This forces developers into a cycle of small commits and repeated pull requests just to verify a workflow works, particularly for checking dependency versions, container setup, and build success.

_Developers debugging flaky CI setups can find tooling tips like this through daily.dev._

## Similar posts on daily.dev

- [GitHub Actions](https://daily.dev/posts/github-actions-igdtp4vhf) · Medium · 1 upvotes · 0 comments
- [A deep dive into GitHub Actions](https://daily.dev/posts/a-deep-dive-into-github-actions-az4oxlp76) · Flavio Copes · 2 upvotes · 0 comments
- [GitHub for Beginners: Getting started with GitHub Actions](https://daily.dev/posts/github-for-beginners-getting-started-with-github-actions-swremqjqc) · GitHub Blog · 0 upvotes · 0 comments
- [GitHub Agentic Workflows generally available](https://daily.dev/posts/github-agentic-workflows-generally-available-ahp2ieyzc) · GitHub Changelog · 0 upvotes · 0 comments

---

Tags: [#testing](https://daily.dev/tags/testing), [#cicd](https://daily.dev/tags/cicd), [#docker](https://daily.dev/tags/docker), [#github-actions](https://daily.dev/tags/github-actions)

[View this post on daily.dev](https://daily.dev/posts/test-github-actions-locally-with-act-xikwrgbox)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Test GitHub Actions Locally with Act","url":"https://daily.dev/posts/test-github-actions-locally-with-act-xikwrgbox","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/test-github-actions-locally-with-act-xikwrgbox"},"datePublished":"2026-09-16T12:09:27.974Z","dateModified":"2026-09-16T12:09:50.887Z","description":"GitHub Actions workflows are notoriously hard to test because a workflow typically must exist on the main branch or use specific triggers before it can be...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/8bd7325224a3fae9aba4f2b5cb6e0533?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/8bd7325224a3fae9aba4f2b5cb6e0533?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Atomic Spin","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Atomic Spin","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/e2af5ce3adaa403a8cf029268b62419f","url":"https://daily.dev/sources/atomicobject"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/test-github-actions-locally-with-act-xikwrgbox","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"testing,cicd,docker,github-actions","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Atomic Spin","item":"https://daily.dev/sources/atomicobject"},{"@type":"ListItem","position":3,"name":"Test GitHub Actions Locally with Act"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/test-github-actions-locally-with-act-xikwrgbox#faq","mainEntity":[{"@type":"Question","name":"How can I test a GitHub Actions workflow locally before merging my pull request?","acceptedAnswer":{"@type":"Answer","text":"Use act, an open-source tool from the nektos/act repository, to run GitHub Actions workflows locally through Docker. Act pulls Docker images that replicate GitHub's environment variables and file system setup, letting you trigger events like pull_request without merging code. Install Docker and act, then run 'act -l' to list workflows and 'act pull-request' to run a specific trigger. daily.dev surfaces practical CI/CD tooling like this for developers refining their GitHub Actions testing workflow."}},{"@type":"Question","name":"Why can't I test a new GitHub Actions workflow just by opening a pull request?","acceptedAnswer":{"@type":"Answer","text":"GitHub Actions only pulls workflows from the main branch, so a workflow added in an open pull request often cannot be triggered or tested until it's merged. This forces developers into a cycle of small commits and repeated pull requests just to verify a workflow works, particularly for checking dependency versions, container setup, and build success. Developers debugging flaky CI setups can find tooling tips like this through daily.dev."}}]}
```

