nektos/act
GitHub: nektos/act
通过 Docker 容器在本地模拟运行 GitHub Actions 工作流,实现快速调试和验证,无需推送代码到远程仓库。
Stars: 69641 | Forks: 1897

# 概述 [](https://github.com/nektos/act/actions) [](https://goreportcard.com/report/github.com/nektos/act) [](https://github.com/jonico/awesome-runners)
在本地运行你的 [GitHub Actions](https://developer.github.com/actions/)!为什么要这样做?有两个理由:
- **快速反馈** - 与其每次为了测试对 `.github/workflows/` 文件的修改(或任何嵌入式 GitHub actions 的更改)而进行 commit/push,不如使用 `act` 在本地运行这些 actions。[环境变量](https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables)和[文件系统](https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners#filesystems-on-github-hosted-runners)都配置为与 GitHub 提供的环境相匹配。
- **本地任务运行器** - 我喜欢 [make](). 然而,我也讨厌重复自己。有了 `act`,你可以利用 `.github/workflows/` 中定义的 GitHub Actions 来替代你的 `Makefile`!
# 它是如何工作的?
当你运行 `act` 时,它会从 `.github/workflows/` 读取你的 GitHub Actions,并确定需要运行的操作集合。它使用 Docker API 来拉取或构建必要的镜像(如你的工作流文件中所定义),并最终根据定义的依赖关系确定执行路径。一旦有了执行路径,它就会使用 Docker API 基于之前准备的镜像为每个操作运行容器。[环境变量](https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables)和[文件系统](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#file-systems)都配置为与 GitHub 提供的环境相匹配。
让我们通过一个[示例仓库](https://github.com/cplee/github-actions-demo)来看看它的实际效果!

# Act 用户指南
请查看 [act 用户指南](https://nektosact.com) 以获取更多文档。
# 支持
需要帮助?请在 [discussions](https://github.com/nektos/act/discussions) 中提问!
# 贡献
想为 act 做贡献?太棒了!请查看 [贡献指南](CONTRIBUTING.md) 参与其中。
## 手动从源码构建
- 安装 Go tools 1.20+ - ()
- 克隆此仓库 `git clone git@github.com:nektos/act.git`
- 使用 `make test` 运行单元测试
- 构建并安装:`make install`
标签:Cloudformation, DNS解析, Docker, EVTX分析, GitHub Actions, GitHub 生态, Go 语言, Makefile 替代, NIDS, Retryablehttp, Workflow 调试, 威胁情报, 安全防御评估, 容器化, 工作流, 开发者工具, 开源框架, 开源项目, 持续集成, 日志审计, 本地开发环境, 本地运行, 自动化构建, 自动笔记, 请求拦截