登录 注册

act (本地运行 GitHub Actions 工具)

去点 Star
开发者工具
72,664
Stars
—
Forks
0
Watchers
—
Open Issues
待补全
许可证
Go
语言
—
创建时间
最近更新

项目能做什么

在本地直接运行与测试 GitHub Actions 工作流的工具。
来源:基于仓库元数据 · 内容以仓库实际 README 为准

使用说明 查看原始 README 原仓库文档

## 项目简介

`act` 是一个让你在本地运行 GitHub Actions 的命令行工具。

它的工作原理是:读取仓库中 `.github/workflows/` 下的 Actions 配置,通过 Docker API 拉取或构建所需镜像,并在容器中模拟 GitHub 的执行环境(包括环境变量和文件系统),在本地执行完整的 workflow 任务链路。

## 核心功能

- **快速反馈循环**:无需每次修改 `.github/workflows/` 后都执行 `git commit` 和 `git push`,直接在本地秒级验证 Actions 配置与逻辑。
- **本地任务执行器(Task Runner)**:直接复用已有的 GitHub Actions 工作流替代传统 `Makefile` 等脚本工具,避免重复编写构建逻辑。
- **VS Code 深度集成**:可通过 VS Code 插件 “GitHub Local Actions” 直接在编辑器内触发和调试 workflow。

## 适合谁用

- 频繁编写、调试 GitHub Actions CI/CD 流水线的开发者。
- 希望在推送到远程仓库前快速完成本地测试与验证的团队与个人。
- 寻找现代化任务执行器来替代复杂 `Makefile` 的开发者。

## 安装步骤

README 原文仅提供了**从源码手动构建**的说明(二进制包/包管理器安装方式原文未列出,请查看原仓库):

1. 安装 Go 环境(所需版本以项目 `go.mod` 为准,目前为 1.26.0,参考官方安装:https://golang.org/doc/install)。
2. 克隆项目仓库:
   ```bash
   git clone git@github.com:nektos/act.git
   cd act
   ```
3. 运行测试(可选):
   ```bash
   # 运行完整单元测试(需要运行 Docker)
   make test

   # 运行无需 Docker 的快速测试
   make test-fast
   ```
4. 构建并安装:
   ```bash
   make install
   ```

*注:运行 `act` 依赖本地已安装并启动 Docker 服务。*

## 配置说明

此部分原文未详细展开具体的命令行参数或配置文件语法。更多高阶用法、工作流事件触发参数请查阅官方文档:[act user guide](https://nektosact.com)。

## 常见问题

- **需要帮助或遇到了 Bug?**
  可以在 GitHub 仓库的 [discussions](https://github.com/nektos/act/discussions) 专区发起提问与讨论。
- **常见报错与兼容性排查**:
  此部分原文未说明,请查看原仓库及官方用户手册。
原始 README 摘录(英文原文,节选前 3000 字符)
<p align="center">
  <img alt="act" src="docs/img/act-logo.svg" width="180" />
</p>

# Overview [![checks](https://github.com/nektos/act/actions/workflows/checks.yml/badge.svg?branch=main)](https://github.com/nektos/act/actions/workflows/checks.yml) [![awesome-runners](https://img.shields.io/badge/listed%20on-awesome--runners-blue.svg)](https://github.com/jonico/awesome-runners)

> "Think globally, `act` locally"

Run your [GitHub Actions](https://developer.github.com/actions/) locally! Why would you want to do this? Two reasons:

- **Fast Feedback** - Rather than having to commit/push every time you want to test out the changes you are making to your `.github/workflows/` files (or for any changes to embedded GitHub actions), you can use `act` to run the actions locally. The [environment variables](https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables) and [filesystem](https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners#filesystems-on-github-hosted-runners) are all configured to match what GitHub provides.
- **Local Task Runner** - I love [make](<https://en.wikipedia.org/wiki/Make_(software)>). However, I also hate repeating myself. With `act`, you can use the GitHub Actions defined in your `.github/workflows/` to replace your `Makefile`!

> [!TIP]
> **Now Manage and Run Act Directly From VS Code!**<br/>
> Check out the [GitHub Local Actions](https://sanjulaganepola.github.io/github-local-actions-docs/) Visual Studio Code extension which allows you to leverage the power of `act` to run and test workflows locally without leaving your editor.

# How Does It Work?

When you run `act` it reads in your GitHub Actions from `.github/workflows/` and determines the set of actions that need to be run. It uses the Docker API to either pull or build the necessary images, as defined in your workflow files and finally determines the execution path based on the dependencies that were defined. Once it has the execution path, it then uses the Docker API to run containers for each action based on the images prepared earlier. The [environment variables](https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables) and [filesystem](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#file-systems) are all configured to match what GitHub provides.

Let's see it in action with a [sample repo](https://github.com/cplee/github-actions-demo)!

![Demo](docs/img/act-quickstart.gif)

# Act User Guide

Please look at the [act user guide](https://nektosact.com) for more documentation.

# Support

Need help? Ask in [discussions](https://github.com/nektos/act/discussions)!

# Contributing

Want to contribute to act? Awesome! Check out the [contributing guidelines](CONTRIBUTING.md) to get involved.

## Manually building from source

- Install Go (version in `go.mod
阅读完整原文

项目深度分析 规则生成(AI 未配置)

综合评分 59.9 分。该项目在“个人可实施性”维度得 50 分,“付费可能性”维度得 60.0 分,差异化空间 58.0 分(评分依据见评分卡)。

将 act 改造为垂直场景 SaaS

产品构想保留核心能力,针对某一类用户(如某行业团队)做托管版,收取月费。
目标用户有该需求的中小团队 / 独立站长
难度/周期中 · 2~4 周(MVP)
收费模式订阅制(如 ¥29~99/月)
竞争风险需验证付费意愿;注意许可证合规
依据 数据支持的判断:许可证与关键词显示存在商用与付费场景

面向细分需求的二次开发产品

产品构想基于 act 的核心能力,聚焦一个更窄的场景(如某平台、某行业)做差异化。
目标用户该细分场景用户
难度/周期中 · 2~6 周
收费模式买断制 / 订阅制 / 广告
竞争风险细分需求规模需验证
依据 AI 推测:基于项目主题标签的判断

封装为在线小工具或 API 服务

产品构想把项目最常用的一个功能做成网页小工具,靠流量变现或按量计费。
目标用户搜索引擎带来的长尾用户
难度/周期低 · 1~3 周
收费模式免费引流 + 增值功能 / API 按量计费
竞争风险同质化竞争,需做好 SEO
依据 AI 推测:基于技术栈与部署特征的判断
以上为规则引擎基于仓库公开数据生成的参考结论,包含推测成分,不构成投资或创业承诺;配置 AI 后可获得更深入的分析。
报告会保存到 个人中心

竞品与相似项目 GitHub Search 真实检索

相似项目数据正在完善中,暂不展示(避免误导)

项目优势与风险

技术成熟度创建时间待补全,最近推送 ,发布过 100 个 Release
社区活跃Star 72,664 / Fork 0 / Issue 0(数据支持,可自行核实)
许可证未检测到(需人工确认)
主要风险上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价

安装与使用

此项目未提供 Docker 镜像,安装步骤以原仓库 README 为准(涉及依赖安装与环境配置,对新手门槛较高)。