[PR #45] [CLOSED] Scaffold a new action with --init (-i) flag #1337

Closed
opened 2026-03-01 21:50:45 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/nektos/act/pull/45
Author: @sosedoff
Created: 2/27/2019
Status: Closed

Base: masterHead: init


📝 Commits (4)

  • dd16951 Add flag --init to scaffold a new workflow and action
  • f35f3c8 Add basic push template
  • c13ca7e Fix
  • b576e17 Pull template from a git repo

📊 Changes

6 files changed (+83 additions, -11 deletions)

View changed files

📝 actions/api.go (+2 -0)
📝 cmd/root.go (+59 -1)
📝 common/file.go (+8 -10)
templates/push/action/Dockerfile (+3 -0)
templates/push/action/entrypoint.sh (+3 -0)
templates/push/main.workflow (+8 -0)

📄 Description

I think act could be improved with a feature to help setting up a new workflow.

For any existing project running act --init [push|pull-request|other event type] will create a new workflow file and an example action template using dummy Dockerfile. It's not much but definitely enough to get rolling with github actions without all the manual work.

New command will only execute if user does not have a .github directory (or whatever is set with workspace dir). In order to get started with a new action using docker, one has to type 2 commands:

cd ~/projects/foobar
act --init
act

And then take it from there to develop and test whatever action they need.

act --init creates the following files in the current directory:

./.github
./.github/main.workflow
./.github/example-action
./.github/example-action/Dockerfile
./.github/example-action/entrypoint.sh

@nektos any thoughts?


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/nektos/act/pull/45 **Author:** [@sosedoff](https://github.com/sosedoff) **Created:** 2/27/2019 **Status:** ❌ Closed **Base:** `master` ← **Head:** `init` --- ### 📝 Commits (4) - [`dd16951`](https://github.com/nektos/act/commit/dd16951ac74f268e0d6a49abe41872fd82238563) Add flag --init to scaffold a new workflow and action - [`f35f3c8`](https://github.com/nektos/act/commit/f35f3c848b52ac11938de0518321c654db77637e) Add basic push template - [`c13ca7e`](https://github.com/nektos/act/commit/c13ca7e8895a3ec64db532d9d680ccf307af6cf9) Fix - [`b576e17`](https://github.com/nektos/act/commit/b576e17e588aee2c3939d392d7b7b6bae1d9f7f9) Pull template from a git repo ### 📊 Changes **6 files changed** (+83 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `actions/api.go` (+2 -0) 📝 `cmd/root.go` (+59 -1) 📝 `common/file.go` (+8 -10) ➕ `templates/push/action/Dockerfile` (+3 -0) ➕ `templates/push/action/entrypoint.sh` (+3 -0) ➕ `templates/push/main.workflow` (+8 -0) </details> ### 📄 Description I think `act` could be improved with a feature to help setting up a new workflow. For any existing project running `act --init [push|pull-request|other event type]` will create a new workflow file and an example action template using dummy Dockerfile. It's not much but definitely enough to get rolling with github actions without all the manual work. New command will only execute if user does not have a `.github` directory (or whatever is set with workspace dir). In order to get started with a new action using docker, one has to type 2 commands: ``` cd ~/projects/foobar act --init act ``` And then take it from there to develop and test whatever action they need. `act --init` creates the following files in the current directory: ``` ./.github ./.github/main.workflow ./.github/example-action ./.github/example-action/Dockerfile ./.github/example-action/entrypoint.sh ``` @nektos any thoughts? --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-01 21:50:45 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#1337
No description provided.