Skip to content

kepi74/act-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Act usage examples

Online resources

Example commands

Welcome

Running a full workflow

act -W act -W .github/workflows/hello.yaml

Basic commands

List all available workflows and its jobs

act -l

List jobs for specific workflow

act -l -W .github/workflows/hello.yaml

Run single job

act -W .github/workflows/hello.yaml -j welcome

Events

Events that trigger workflows

push - default event used

act -W .github/workflows/events.yaml

push with defined event data

act -W .github/workflows/events.yaml -e events/push.json

pull_request

act pull_request -W .github/workflows/events.yaml

pull_request with defined event data

Opened PR

act pull_request -W .github/workflows/events.yaml -e events/pull_request.opened.json

Labeled PR

act pull_request -W .github/workflows/events.yaml -e events/pull_request.labeled.json

sheduled

act scheduled -W .github/workflows/events.yaml

Workflow with cache

First run without cache server

act -W .github/workflows/cache.yaml

Install Cache server

Installation: github-act-cache-server

Environment variables used in the .actrc

--env ACTIONS_CACHE_URL=http://127.0.0.1:8080/
--env ACTIONS_RUNTIME_URL=http://127.0.0.1:8080/
--env ACTIONS_RUNTIME_TOKEN=foo

Skip Job when using the Act

act -W .github/workflows/skip-job.yaml -e events/push.json

add "act": true into `events/push.json and re-run

Using local code for the shared action

Replace actions/setup-node with the local mock

act -W .github/workflows/cache.yaml --local-repository https://github.com/actions/setup-node@v4=./fake-setup-node

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors