<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="https://nodewaveblog.vercel.app/feed.xsl"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="https://search.yahoo.com/mrss/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
          <atom:link href="https://nodewaveblog.vercel.app/categories/devops/rss.xml" rel="self" type="application/rss+xml" />
        <atom:link href="https://nodewaveblog.vercel.app/categories/rss.xml" rel="up" type="application/rss+xml" title="Categories Directory Feed" />
        <atom:link href="https://nodewaveblog.vercel.app/rss.xml" rel="up" type="application/rss+xml" title="Master Root Feed" />
        <title>NodeWave — Category: devops</title>
        <link>https://nodewaveblog.vercel.app/</link>
        <description>RSS feed for articles and development logs categorized under devops on NodeWave.</description>
        <lastBuildDate>Tue, 01 Dec 2026 21:29:59 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>Nodewave RSS Engine</generator>
        <language>en</language>
        <image>
            <title>NodeWave — Category: devops</title>
            <url>https://nodewaveblog.vercel.app/logo.png</url>
            <link>https://nodewaveblog.vercel.app/</link>
        </image>
        <copyright>Copyright © 2026 NodeWave. All rights reserved.</copyright>
        <item>
            <title><![CDATA[Debug Pipelines Locally - The Complete Guide to Running GitHub Actions with Act]]></title>
            <link>https://nodewaveblog.vercel.app/blogs/local-github-actions</link>
            <guid isPermaLink="false">https://nodewaveblog.vercel.app/blogs/local-github-actions</guid>
            <pubDate>Fri, 26 Jun 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Learn how to use Act to run, test, and step-debug your GitHub Actions workflows locally, saving time and keeping your commit history clean.]]></description>
            <content:encoded><![CDATA[<p>We have all been trapped in the infamous <strong>CI/CD commit loop</strong>. You make a change to a <code>.github/workflows/ci.yml</code> file, commit it, push it, wait five minutes for a cloud runner to spin up, and realize you missed a minor indentation or a basic syntax flag.</p><p>Ten commits later, your Git history is littered with messages like <code>&quot;fix ci&quot;</code>, <code>&quot;fix ci again&quot;</code>, and <code>&quot;please work&quot;</code>.</p><p>It doesn’t have to be this way. By utilizing <strong>Act</strong>, an open-source tool that reads your GitHub Actions files and spins them up inside local Docker containers, you can run, test, and debug your entire automation pipeline locally in seconds.</p><hr /><h2 id="step-1-core-prerequisites-and-architecture">Step 1: Core Prerequisites and Architecture</h2><p>Under the hood, <code>act</code> uses your local container engine to mimic the hosted virtual environments provided by GitHub (like <code>ubuntu-latest</code>).</p><p>Before starting, ensure you have the following installed and running:</p><ol><li><strong>Docker Desktop</strong> (or Podman / Docker Engine via WSL2).</li><li><strong>Your Terminal Shell</strong> (Bash, Zsh, or PowerShell).</li></ol><h3 id="installing-act">Installing Act</h3><p>Install the binary framework via your system package manager:</p><pre class="language-bash shiki shiki-themes material-theme-lighter github-light github-dark" style=""><code><span class="line" line="1"><span class="sutJx"># macOS (Homebrew)
</span></span><span class="line" line="2"><span class="sbgvK">brew</span><span class="s_sjI"> install</span><span class="s_sjI"> nektos/tap/act
</span></span><span class="line" line="3"><span emptyLinePlaceholder>
</span></span><span class="line" line="4"><span class="sutJx"># Windows (Winget or Scoop)
</span></span><span class="line" line="5"><span class="sbgvK">winget</span><span class="s_sjI"> install</span><span class="s_sjI"> nektos.act
</span></span><span class="line" line="6"><span class="sutJx"># OR: scoop install act
</span></span><span class="line" line="7"><span emptyLinePlaceholder>
</span></span><span class="line" line="8"><span class="sutJx"># Linux (Bash script installation)
</span></span><span class="line" line="9"><span class="sbgvK">curl</span><span class="stzsN"> --proto</span><span class="sjJ54"> &apos;</span><span class="s_sjI">=https</span><span class="sjJ54">&apos;</span><span class="stzsN"> --tlsv1.2</span><span class="stzsN"> -sSf</span><span class="s_sjI"> https://githubusercontent.com</span><span class="smGrS"> |</span><span class="sbgvK"> sudo</span><span class="s_sjI"> sh
</span></span></code></pre><p>Verify your installation works by checking the core version output:</p><pre class="language-bash shiki shiki-themes material-theme-lighter github-light github-dark" style=""><code><span class="line" line="1"><span class="sbgvK">act</span><span class="stzsN"> --version
</span></span></code></pre><hr /><h2 id="step-2-the-initial-sandbox-setup">Step 2: The Initial Sandbox Setup</h2><p>The first time you execute <code>act</code> inside a repository, it will ask you to select a default Docker image size to represent the <code>ubuntu-latest</code> runner.</p><p>Run a basic list command to trigger this configuration menu:</p><pre class="language-bash shiki shiki-themes material-theme-lighter github-light github-dark" style=""><code><span class="line" line="1"><span class="sbgvK">act</span><span class="stzsN"> -l
</span></span></code></pre><h3 id="choosing-the-right-runner-size">Choosing the Right Runner Size:</h3><ul><li><strong>Micro (Default):</strong> ~200MB image. Fast to download but contains almost no tools. You will manually have to install basics like <code>curl</code>, <code>git</code>, or languages inside your steps.</li><li><strong>Medium:</strong> ~500MB+ image. Contains common build tools, Node.js, Python, and Docker dependencies. <strong>(Highly Recommended for most devs)</strong>.</li><li><strong>Large:</strong> ~18GB+ image. A near-exact match of the actual GitHub cloud environment. Massive download, but highly accurate.</li></ul><p><em>Note: If you want to change your mind later, you can modify these choices inside your global config file at <code>~/.actrc</code>.</em></p><hr /><h2 id="step-3-executing-your-local-pipeline">Step 3: Executing Your Local Pipeline</h2><p>Imagine you have a standard test workflow saved inside <code>.github/workflows/test.yml</code> that triggers on a code push event:</p><pre class="language-yaml shiki shiki-themes material-theme-lighter github-light github-dark" style=""><code><span class="line" line="1"><span class="sQzsp">name</span><span class="sP7_E">:</span><span class="s_sjI"> Core Test Suite
</span></span><span class="line" line="2"><span class="syTEX">on</span><span class="sP7_E">:</span><span class="sP7_E"> [</span><span class="s_sjI">push</span><span class="sP7_E">]
</span></span><span class="line" line="3"><span emptyLinePlaceholder>
</span></span><span class="line" line="4"><span class="sQzsp">jobs</span><span class="sP7_E">:
</span></span><span class="line" line="5"><span class="sQzsp">  build-and-test</span><span class="sP7_E">:
</span></span><span class="line" line="6"><span class="sQzsp">    runs-on</span><span class="sP7_E">:</span><span class="s_sjI"> ubuntu-latest
</span></span><span class="line" line="7"><span class="sQzsp">    steps</span><span class="sP7_E">:
</span></span><span class="line" line="8"><span class="sP7_E">      -</span><span class="sQzsp"> name</span><span class="sP7_E">:</span><span class="s_sjI"> Checkout Code
</span></span><span class="line" line="9"><span class="sQzsp">        uses</span><span class="sP7_E">:</span><span class="s_sjI"> actions/checkout@v4
</span></span><span class="line" line="10"><span emptyLinePlaceholder>
</span></span><span class="line" line="11"><span class="sP7_E">      -</span><span class="sQzsp"> name</span><span class="sP7_E">:</span><span class="s_sjI"> Setup Node Environment
</span></span><span class="line" line="12"><span class="sQzsp">        uses</span><span class="sP7_E">:</span><span class="s_sjI"> actions/setup-node@v4
</span></span><span class="line" line="13"><span class="sQzsp">        with</span><span class="sP7_E">:
</span></span><span class="line" line="14"><span class="sQzsp">          node-version</span><span class="sP7_E">:</span><span class="srdBf"> 20
</span></span><span class="line" line="15"><span emptyLinePlaceholder>
</span></span><span class="line" line="16"><span class="sP7_E">      -</span><span class="sQzsp"> name</span><span class="sP7_E">:</span><span class="s_sjI"> Install and Run Tests
</span></span><span class="line" line="17"><span class="sQzsp">        run</span><span class="sP7_E">:</span><span class="sVHd0"> |
</span></span><span class="line" line="18"><span class="s_sjI">          npm ci
</span></span><span class="line" line="19"><span class="s_sjI">          npm test
</span></span></code></pre><p>To run this workflow completely offline from the root of your project directory, simply run:</p><pre class="language-bash shiki shiki-themes material-theme-lighter github-light github-dark" style=""><code><span class="line" line="1"><span class="sbgvK">act</span><span class="s_sjI"> push
</span></span></code></pre><p><code>act</code> will intercept the <code>push</code> event string, match it to the workflow file, compile your code directories directly into a Docker container workspace volumes matrix, and stream the console outputs in real-time.</p><hr /><h2 id="step-4-advanced-scenarios-events-secrets-and-artifacts">Step 4: Advanced Scenarios — Events, Secrets, and Artifacts</h2><p>Real pipelines are rarely as simple as a basic push. They rely on webhooks, secure deployment keys, and matrix configurations. Here is how to manage complex environments locally.</p><h3 id="simulating-specific-webhook-events">Simulating Specific Webhook Events</h3><p>If your workflow triggers on a complex event like a <code>pull_request</code> or an <code>issue_comment</code>, you can pass mock JSON payloads to test targeted behaviors.</p><p>Create a file named <code>mock-event.json</code>:</p><pre class="language-json shiki shiki-themes material-theme-lighter github-light github-dark" style=""><code><span class="line" line="1"><span class="sP7_E">{
</span></span><span class="line" line="2"><span class="s39Yj">  &quot;</span><span class="sseR_">pull_request</span><span class="s39Yj">&quot;</span><span class="sP7_E">:</span><span class="sP7_E"> {
</span></span><span class="line" line="3"><span class="s39Yj">    &quot;</span><span class="sZMiF">head</span><span class="s39Yj">&quot;</span><span class="sP7_E">:</span><span class="sP7_E"> {</span><span class="s39Yj"> &quot;</span><span class="srdBf">ref</span><span class="s39Yj">&quot;</span><span class="sP7_E">:</span><span class="sjJ54"> &quot;</span><span class="s_sjI">feature-branch</span><span class="sjJ54">&quot;</span><span class="sP7_E"> },
</span></span><span class="line" line="4"><span class="s39Yj">    &quot;</span><span class="sZMiF">base</span><span class="s39Yj">&quot;</span><span class="sP7_E">:</span><span class="sP7_E"> {</span><span class="s39Yj"> &quot;</span><span class="srdBf">ref</span><span class="s39Yj">&quot;</span><span class="sP7_E">:</span><span class="sjJ54"> &quot;</span><span class="s_sjI">main</span><span class="sjJ54">&quot;</span><span class="sP7_E"> }
</span></span><span class="line" line="5"><span class="sP7_E">  }
</span></span><span class="line" line="6"><span class="sP7_E">}
</span></span></code></pre><p>Trigger your workflow by passing the event type and payload path flags:</p><pre class="language-bash shiki shiki-themes material-theme-lighter github-light github-dark" style=""><code><span class="line" line="1"><span class="sbgvK">act</span><span class="s_sjI"> pull_request</span><span class="stzsN"> -e</span><span class="s_sjI"> mock-event.json
</span></span></code></pre><h3 id="safely-injecting-secrets-and-variables">Safely Injecting Secrets and Variables</h3><p>Never hardcode production API tokens or environment configs into your files. <code>act</code> allows you to load mock credentials locally using <code>.env</code> syntax files.</p><p>Create a file named <code>.secrets</code> (and add it to your <code>.gitignore</code> immediately!):</p><pre class="language-env shiki shiki-themes material-theme-lighter github-light github-dark" style=""><code><span class="line" line="1"><span>AWS_ACCESS_KEY_ID=MOCK_LOCAL_KEY_12345
</span></span><span class="line" line="2"><span>DEPLOY_TOKEN=ghp_MockSecretTokenStringHere
</span></span></code></pre><p>Inject these variables directly into your execution context using the secure secret loader flag:</p><pre class="language-bash shiki shiki-themes material-theme-lighter github-light github-dark" style=""><code><span class="line" line="1"><span class="sbgvK">act</span><span class="stzsN"> --secret-file</span><span class="s_sjI"> .secrets
</span></span></code></pre><h3 id="isolating-individual-jobs">Isolating Individual Jobs</h3><p>If your workflow file contains multiple long-running jobs (e.g., <code>lint</code>, <code>test</code>, <code>deploy</code>) and you only want to focus on fixing a specific piece, use the targeted job parameter flag:</p><pre class="language-bash shiki shiki-themes material-theme-lighter github-light github-dark" style=""><code><span class="line" line="1"><span class="sbgvK">act</span><span class="stzsN"> -j</span><span class="s_sjI"> build-and-test
</span></span></code></pre><hr /><h2 id="step-5-common-gotchas-and-limitations">Step 5: Common Gotchas and Limitations</h2><p>While <code>act</code> is incredibly powerful, it is a simulation wrapper, not an identical duplicate of the GitHub cloud architecture. Keep these structural limitations in mind:</p><ul><li><strong>Windows/macOS Runners:</strong> <code>act</code> runs natively inside Linux Docker environments. If your workflow declares <code>runs-on: windows-latest</code> or <code>runs-on: macos-latest</code>, <code>act</code> will attempt to run them inside Linux wrappers, which will fail if you rely on native binaries like MSBuild or Xcode.</li><li><strong>The Checkout Action Caveat:</strong> The native <code>actions/checkout@v4</code> action usually fetches historical branches. When executed via <code>act</code>, it copies your live local tracking directory as-is. Make sure your local folder doesn&apos;t contain giant compiled file structures that will slow down your container mounting states! Use a <code>.actignore</code> file to omit massive binary data.</li></ul><h2 id="wrapping-up">Wrapping Up</h2><p>Adding <code>act</code> to your localized DevOps toolchain fundamentally changes how you develop automation infrastructure. It shortens your loop testing times from minutes to fractions of a second, protects your repository&apos;s commit history from pollution, and ensures that when your pipeline finally makes it to the cloud, it works flawlessly on the very first try.</p>]]></content:encoded>
            <author>yebei@nodewave.net (Gideon Yebei)</author>
            <category domain="https://nodewaveblog.vercel.app/categories/devops">devops</category>
            <category domain="https://nodewaveblog.vercel.app/tags/github-actions">Github Actions</category>
            <category domain="https://nodewaveblog.vercel.app/tags/devops">DevOps</category>
            <category domain="https://nodewaveblog.vercel.app/tags/docker">Docker</category>
            <enclosure url="https://nodewaveblog.vercel.app/blogs/posts/local-github-actions/cover.png" length="0" type="image/png"/>
        </item>
    </channel>
</rss>