act README

The project's README from github.com/nektos/act. As one markdown file: README.md.

act-logo

Overview push Go Report Card awesome-runners

"Think globally, act locally"

Run your GitHub Actions locally! Why would you want to do this? Two reasons:

[!TIP] Now Manage and Run Act Directly From VS Code!
Check out the GitHub Local Actions 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 and filesystem are all configured to match what GitHub provides.

Let's see it in action with a sample repo!

Demo

Act User Guide

Please look at the act user guide for more documentation.

Support

Need help? Ask in discussions!

Contributing

Want to contribute to act? Awesome! Check out the contributing guidelines to get involved.

Manually building from source

act (nektos/act)

Searching Database…

72.4K ·GitHub
这是什么?act 让你可以在本地运行 GitHub Actions 工作流,不必每次为了测试 .github/workflows 的修改都推送到 GitHub。
它是命令行工具,还是别的什么?它是一个命令行工具(用 Go 编写),另外还有一个非官方的 VS Code 扩展,可以在编辑器里运行它。
我该怎么让它运行起来?安装 act 可执行文件,然后在包含 .github/workflows 文件夹的仓库中运行它;它会读取你的工作流文件并执行。
我需要先安装 Docker 吗?需要。act 通过 Docker API 拉取或构建工作流文件中定义的镜像,并把每个操作作为容器来运行。
它能完全复刻 GitHub 真实的 runner 环境吗?除了说明 act 会让环境变量和文件系统与 GitHub 保持一致外,并没有明确说明其他内容。不过,它是在本地 Docker 容器中运行操作,而不是在 GitHub 实际托管的 runner 上运行,因此一些边缘情况可能会有差异。
这对谁有用?希望快速验证工作流修改、又不想每次都提交和推送的开发者;或者想把 GitHub Actions 定义当作本地任务运行器、用来替代 Makefile 的人。
act 能完全替代我的 Makefile 吗?能。作者建议直接把 .github/workflows/ 中已定义的 GitHub Actions 当作本地任务运行器,而不必再维护单独的 Makefile。
Creator
nektos
Size
17.3 MB
Stars
72.4K
Age
7y
Commits · 90 Days