[GitHub Action] How to run GitHub action locally

For debugging pipeline, it is common to save, push and execute pipeline manually. However it is not a good idea because it might increase unnecessary commit and pull request in branch. It can be solved by run the pipeline locally to ensure everything correct before push and execute. In this demo, it will execute GitHub action locally in Windows.

Prerequisites

  1. Ensure required windows feature are installed properly.
    In Windows feature, ensure Hyper-V, Virtual Machine Platform and Windows Subsystem for Linux are checked, if not, tick missing items and click OK to install it. Restart computer after installed.
  2. Ensure required packages are installed.
    Check docker engine install or not; install it and restart computer if missing;

Steps

  1. Install act
    Execute command in Terminal below to install act. Or you can follow act user guide to install in another way.

    choco install act-cli
  2. Execute and verify
    Execute command in Terminal below, expected it can executed successfully if step do not required specific credentials.

    act --pull=false

Reference

  1. act user guide, nektosact, https://nektosact.com/
About C.H. Ling 262 Articles
a .net / Java developer from Hong Kong and currently located in United Kingdom. Thanks for Google because it solve many technical problems so I build this blog as return. Besides coding and trying advance technology, hiking and traveling is other favorite to me, so I will write down something what I see and what I feel during it. Happy reading!!!

Be the first to comment

Leave a Reply

Your email address will not be published.


*


This site uses Akismet to reduce spam. Learn how your comment data is processed.