PromptHub
Developer Tools DevOps

Stop Pushing Broken CI! Run GitHub Actions Locally in VS Code

B

Bright Coding

Author

13 min read
35 views
Stop Pushing Broken CI! Run GitHub Actions Locally in VS Code

Stop Pushing Broken CI! Run GitHub Actions Locally in VS Code

Every developer knows the soul-crushing cycle. You craft what feels like a perfect workflow file. You commit. You push. You wait. And then—red X. Another failed GitHub Actions run. Another embarrassing fix commit with a message like "try again" or "debug ci." Your team sees it. Your commit history suffers. And you've just burned through precious CI minutes for a typo in a YAML file.

What if you could break this cycle forever?

What if you could run, debug, and perfect your GitHub Actions workflows without ever pushing a single commit?

Enter github-local-actions—the Visual Studio Code extension that's quietly becoming the secret weapon of developers who refuse to tolerate broken CI pipelines. Built by Sanjula Ganepola and powered by the battle-tested nektos/act CLI tool, this extension transforms your editor into a local GitHub Actions powerhouse. No more guesswork. No more shame commits. Just pure, iterative workflow perfection from the comfort of your familiar VS Code environment.

Ready to reclaim your sanity? Let's dive deep into why github-local-actions is about to become the most important tool in your DevOps arsenal.


What is github-local-actions?

github-local-actions is a Visual Studio Code extension that enables developers to execute GitHub Actions workflows directly on their local machine—all without leaving the editor. It serves as a sophisticated graphical interface layered atop the nektos/act CLI, abstracting away complexity while preserving the raw power of local workflow execution.

Created by Sanjula Ganepola, this extension addresses a fundamental pain point in modern development: the feedback loop gap between writing CI/CD configuration and validating its behavior. Traditional GitHub Actions development requires pushing to a remote repository, waiting for runners to spin up, and parsing logs through a web interface. This friction adds minutes—or hours—to what should be rapid iteration cycles.

The extension is trending now because it arrives at a critical inflection point. Teams are shipping faster than ever. CI/CD pipelines have grown from simple linters to complex orchestration layers with matrix builds, containerized jobs, secrets management, and conditional execution. The cost of pipeline failures—in time, money, and developer morale—has never been higher. Meanwhile, the official GitHub Actions extension for VS Code only views workflows; it doesn't execute them. github-local-actions fills this execution void with an interface deliberately designed to mirror the official extension's familiarity, minimizing cognitive overhead for existing users.

By leveraging Docker containers that replicate GitHub's hosted runner environment—including matching environment variables and filesystems—the extension guarantees environmental parity. What works locally works in production. That's not a promise many CI tools can make.


Key Features That Set It Apart

The github-local-actions extension packs capabilities that transform how developers interact with CI/CD configuration. Here's what makes it indispensable:

🚀 Run Workflows and Jobs with Surgical Precision

Execute entire workflows or isolate specific jobs for targeted debugging. This granularity matters enormously when you're troubleshooting a failing step in a 15-job matrix build. Instead of running everything, you pinpoint exactly what needs attention.

Trigger Events Authentically

GitHub Actions respond to dozens of events—push, pull_request, workflow_dispatch, schedule, and more. The extension lets you trigger standard GitHub events to run multiple workflows simultaneously, accurately simulating real repository conditions. Test your on: pull_request logic without creating actual pull requests.

📖 Persistent Workflow Run History

Debugging CI failures requires context. The History view maintains comprehensive logs of past executions, enabling comparative analysis between runs. When did this step start failing? What changed? The answer lives in your local history.

⚙️ Comprehensive Settings Management

Real workflows depend on secrets, variables, inputs, and runner configurations. The extension provides dedicated interfaces for:

  • Secrets: Configure sensitive data without hardcoding
  • Variables: Define workflow variables and import directly from GitHub
  • Inputs: Assign values for workflow_dispatch triggers
  • Runners: Customize execution environments, including host system fallback for non-container jobs
  • Payloads: Structure event properties for accurate simulation
  • Options: Fine-tune cache, artifacts, and container behaviors

🎯 VS Code Native Integration

Every execution runs as a VS Code task, integrating seamlessly with your existing keyboard shortcuts, problem matchers, and terminal workflows. No context switching. No alien interfaces.


Real-World Use Cases Where It Shines

1. The Pre-Commit Workflow Validator

You're adding a new deployment stage to your production pipeline. One malformed if: condition could break releases for your entire team. With github-local-actions, you iterate locally—testing conditions, verifying environment variable interpolation, and confirming step ordering—before any commit touches your repository.

2. The Secrets-Dependent Debugging Scenario

Your workflow fails only when accessing GITHUB_TOKEN or repository secrets. Reproducing this locally was previously impossible without dangerous workarounds. Now, configure secrets in the Settings view and execute with identical authentication contexts. Debug secret-handling logic safely, offline.

3. The Matrix Build Optimization Project

You're running tests across Node 18, 20, and 22 on Ubuntu, macOS, and Windows. Matrix builds consume enormous CI minutes when misconfigured. Test your matrix strategy locally, validate job distribution, and verify artifact collection—then push the perfected configuration.

4. The Event-Driven Workflow Developer

Building complex automation triggered by issue_comment, release, or custom repository dispatch events? Previously, testing required elaborate webhook simulations or actual repository events. Now, trigger any standard GitHub event locally with configurable payloads. Your if: github.event.action == 'published' logic works correctly the first time.

5. The New Team Member Onboarding Accelerator

Junior developers often fear touching CI configuration. With github-local-actions, they experiment safely—learning GitHub Actions syntax, understanding execution flow, and building confidence through local experimentation without risking production pipelines.


Step-by-Step Installation & Setup Guide

Getting started with github-local-actions requires minimal setup but delivers maximum impact. Follow these steps precisely.

Prerequisites

Before installation, ensure your system meets these requirements:

  1. Visual Studio Code (latest stable version recommended)
  2. Docker Engine — Required if running workflows in containers (the default behavior). Install from Docker's official documentation.
  3. Optional: nektos/act CLI — The extension can install this automatically, but manual installation gives you version control.

Pro Tip: If you're on Windows or macOS and only need to run specific workflow jobs directly on your host system, Docker is not required. See the runners documentation for host system configuration.

Extension Installation

Method 1: VS Code Marketplace (Recommended)

Open VS Code and navigate to the Extensions view (Ctrl+Shift+X or Cmd+Shift+X). Search for:

GitHub Local Actions

Click Install on the extension by SanjulaGanepola.

Method 2: Direct Marketplace Link

Visit the Visual Studio Marketplace and click Install to open directly in VS Code.

Component Setup

After installation, open the Components view in the activity bar. The extension will detect whether nektos/act and Docker are available:

# Verify Docker is running
docker --version
docker ps

# If manually installing act (optional)
curl https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash

The Components view provides status indicators and installation assistance for any missing dependencies.

Workspace Configuration

Open any repository containing .github/workflows/*.yml files. The Workflows view automatically discovers and displays available workflows. No additional configuration files needed—the extension respects your existing GitHub Actions structure.

Initial Settings Configuration

Before your first run, configure essential settings in the Settings view:

  1. Secrets: Add repository secrets your workflows require
  2. Variables: Define environment-specific values
  3. Runners: Confirm default runner or switch to host system for applicable jobs

REAL Code Examples from the Repository

The github-local-actions extension doesn't require you to write new configuration files—it leverages your existing GitHub Actions workflows. However, understanding how the extension interprets and executes these files is crucial for effective local development.

Example 1: Basic Workflow Discovery and Execution

Consider a standard workflow file at .github/workflows/ci.yml:

# .github/workflows/ci.yml
name: CI Pipeline

on:
  push:
    branches: [main, develop]
  pull_request:
    branches: [main]

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [18, 20, 22]
    steps:
      - uses: actions/checkout@v4
      - name: Setup Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v4
        with:
          node-version: ${{ matrix.node-version }}
      - run: npm ci
      - run: npm test

With github-local-actions, this workflow appears automatically in your Workflows view. Right-click and select Run Workflow to execute all jobs, or expand to run individual matrix combinations. The extension constructs the equivalent act command:

# Command the extension executes internally (shown for understanding)
act push --workflows .github/workflows/ci.yml --job test

The extension handles event simulation, passing the correct payload so github.ref, github.event_name, and other context variables populate accurately.

Example 2: Workflow Dispatch with Inputs

For manually triggered workflows requiring inputs:

# .github/workflows/deploy.yml
name: Deploy to Production

on:
  workflow_dispatch:
    inputs:
      environment:
        description: 'Deployment target'
        required: true
        default: 'staging'
        type: choice
        options:
          - staging
          - production
      version:
        description: 'Release version'
        required: true
        type: string

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
      - name: Deploy ${{ github.event.inputs.environment }}
        run: |
          echo "Deploying version ${{ github.event.inputs.version }}"
          ./scripts/deploy.sh ${{ github.event.inputs.environment }}

In the Settings view, navigate to Inputs and define:

  • environment: staging
  • version: 1.2.3

Then trigger via Run Eventworkflow_dispatch. The extension passes these values through act's --input flags, ensuring github.event.inputs.* resolves correctly in your local execution.

Example 3: Secrets-Dependent Authentication Flow

When workflows authenticate with external services:

# .github/workflows/release.yml
name: Publish Package

on:
  release:
    types: [published]

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '20'
          registry-url: 'https://registry.npmjs.org'
      - run: npm ci
      - run: npm publish
        env:
          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Configure NPM_TOKEN in the Settings view under Secrets. The extension maps this to act's --secret flag:

# Equivalent act command
act release --secret NPM_TOKEN=your_token_here

Your local execution now mirrors production authentication behavior without exposing secrets in your repository.

Example 4: Custom Event Payload Configuration

For event-driven workflows requiring specific payload structures:

# .github/workflows/pr-review.yml
name: PR Review Automation

on:
  pull_request:
    types: [opened, synchronize]
    paths:
      - 'src/**'

jobs:
  analyze:
    if: github.event.pull_request.draft == false
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          ref: ${{ github.event.pull_request.head.sha }}
      - name: Run analysis
        run: |
          echo "Analyzing PR #${{ github.event.pull_request.number }}"
          echo "Changed files: ${{ github.event.pull_request.changed_files }}"

In SettingsPayloads, construct a JSON payload matching GitHub's pull_request event structure:

{
  "pull_request": {
    "number": 42,
    "draft": false,
    "head": {
      "sha": "abc123def456"
    },
    "changed_files": 3
  }
}

Trigger Run Eventpull_request with this payload. The if: condition evaluates correctly, and all github.event.* references resolve with your test data.


Advanced Usage & Best Practices

Optimize Container Startup with Image Caching

The first run pulls Docker images matching GitHub's runner environments. These are substantial downloads. Keep Docker running between sessions to preserve cached layers. Configure image variants in Options if you need smaller micro or medium runners instead of the default ubuntu-latest equivalent.

Leverage Host System Runners for Speed

Not every job needs container isolation. For pure script execution without environment dependencies, configure Runners to use your host system. This eliminates Docker overhead entirely—ideal for rapid iteration on simple workflows.

Version-Control Your Local Settings

Export your Settings configurations (secrets excluded, obviously) and share with teammates. Consistent local environments reduce "works on my machine" discrepancies in CI behavior.

Integrate with VS Code Tasks and Keybindings

Since executions run as VS Code tasks, bind frequently used workflows to custom keyboard shortcuts. One keystroke to validate your entire pipeline.

Monitor History for Regression Patterns

When workflows mysteriously fail after weeks of stability, the History view becomes your time machine. Compare successful and failed runs to identify environmental drift or dependency changes.


Comparison with Alternatives

Feature github-local-actions nektos/act CLI Only Official GitHub Actions Extension Pushing to GitHub
Local Execution ✅ Native in VS Code ✅ Terminal-based ❌ View only ❌ Requires commit
Visual Interface ✅ Integrated panels ❌ Command line ✅ Read-only visualization ❌ Web UI only
Event Simulation ✅ GUI-configurable ✅ Manual flags ❌ Not applicable ✅ Authentic events
Secrets Management ✅ Secure input forms ⚠️ Command history risk ❌ Not applicable ✅ Encrypted storage
Execution History ✅ Persistent local logs ❌ Terminal scrollback ❌ Not applicable ✅ GitHub web logs
Learning Curve ✅ Familiar VS Code patterns ⚠️ act CLI knowledge needed ✅ Low ❌ Commit overhead
Iteration Speed ✅ Seconds ✅ Seconds N/A ❌ Minutes to hours

The verdict? Raw act CLI offers identical execution capabilities but demands terminal proficiency and manual flag construction. The official GitHub extension provides beautiful workflow visualization but stops short of execution. github-local-actions uniquely combines both worlds: the power of local execution with the usability of a first-class VS Code integration.


Frequently Asked Questions

Is github-local-actions free to use?

Yes, the extension is completely free and open-source. The underlying nektos/act tool is also free. You only incur costs if your workflows consume paid services during local execution.

Does it support all GitHub Actions features?

It supports all features that nektos/act supports, which covers the vast majority of common workflows. Extremely recent GitHub Actions features may require updating your act version through the Components view.

Can I use this without Docker installed?

Yes, but with limitations. Jobs specifying runs-on: ubuntu-latest require Docker for containerized execution. However, you can configure Runners to use your host system for applicable jobs, bypassing Docker entirely.

How do I handle repository secrets securely?

Secrets are configured through the Settings view and passed to act at runtime. They're never written to disk in your workflow files. For team sharing, document required secrets without including values.

Will my local results exactly match GitHub's runners?

The extension uses Docker images designed to mirror GitHub's hosted runner environment, including matching environment variables and filesystem structure. While extremely close, subtle differences in underlying infrastructure can occasionally cause minor discrepancies.

Can I contribute to the extension?

Absolutely! The project welcomes contributions. See the contributing guide for guidelines, and join discussions on the GitHub repository.

Where do I report bugs in the actual act tool?

For issues specific to nektos/act behavior rather than the VS Code extension interface, report directly to the nektos/act issues repository.


Conclusion: Your CI/CD Workflow Deserves Better

The era of commit-and-pray CI development is over. Every pushed failure costs you time, money, and professional credibility. github-local-actions hands you the power to validate, debug, and perfect your GitHub Actions workflows with the immediacy of local development and the fidelity of production execution.

Sanjula Ganepola has built something genuinely transformative—not by reinventing workflow execution, but by meeting developers where they already work. Inside VS Code. With familiar patterns. Without context switching.

Whether you're a solo developer tired of embarrassing fix commits or a team lead seeking to protect CI minute budgets, this extension delivers measurable, immediate value. The installation takes minutes. The first successful local workflow run—avoiding a would-be failure—pays for itself infinitely.

Stop pushing broken CI. Start shipping with confidence.

👉 Install GitHub Local Actions from the VS Code Marketplace

Star the repository on GitHub

📖 Explore the full documentation

Your future self—and your clean commit history—will thank you.

Comments (0)

Comments are moderated before appearing.

No comments yet. Be the first to share your thoughts!

Support us! ☕