Post

GitHub Actions - Act - CMDsheet

GitHub Actions - Act - CMDsheet

Introduction

  • Act is a tool to run your GitHub Actions locally

  • Benefits

    1. 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 and filesystem are all configured to match what GitHub provides.
    2. Local Task Runner
      • With act, you can use the GitHub Actions defined in your .github/workflows/ to replace your Makefile!
  • Reference Guide: https://nektosact.com/introduction.html

Command Line Arguments

Run all workflows in .github/workflowsact
Run the workflows with push eventact push
Run the workflows with pull request eventact pull_request
Run the workflows with schedule eventact schedule
To list all workflows for a given eventact -l pull_request
To list all jobs in all workflowsact -j 'test'
To pass inputs to the workflowact --input Name=somevalue
To pass input file to the workflowact --input-file myvars.env
To run in Offline modeact --action-offline-mode
This post is licensed under CC BY 4.0 by the author.