Supercharging Your Workflows with Local GitHub Actions



This content originally appeared on DEV Community and was authored by CodeNameGrant

If you’ve worked with GitHub Actions before, you’ve probably pulled in a bunch of ready-made steps from the Marketplace. That’s awesome for common needs like setting up Node, caching dependencies, or deploying to cloud providers.

But what about those repetitive, project-specific steps that aren’t worth publishing to the whole world? That’s where local GitHub Actions shine.

What Are Local Actions?

A local action is a custom GitHub Action that lives inside your own repository. Unlike Marketplace Actions, they’re not shared publicly—just tailored helpers your workflows can use again and again.

They live under the special .github/actions/ directory in your repo:

.github/   
  actions/
    bootstrap-node/
      README.md (optional)
      action.yml

From here, you can call them in any workflow as if they were published actions.

Demo: Bootstrap Node Environment

Let’s say multiple workflows in your project need the same basic setup:

  • Setup Node.js

  • Run npm ci

Instead of repeating that block everywhere (and making sure they all use Node v20 and cache npm correctly), you create a local action:

.github/actions/bootstrap-node/action.yml

name: 'Bootstrap Node Environment'
description: 'Sets up Node.js (version 20) and optionally installs npm dependencies'
inputs:
  installDeps:
    description: 'Whether to install npm dependencies'
    required: false
    default: 'true'

runs:
  using: 'composite'

  steps:
    - name: Setup Node.js
      uses: actions/setup-node@v4
      with:
        node-version: 20
        cache: 'npm'

    - name: Install dependencies
      if: ${{ inputs.installDeps == 'true' }}
      shell: bash
      run: npm ci

Usage in a workflow

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: ./.github/actions/bootstrap-node
        with:
          installDeps: true

Now every workflow that needs a Node environment can use this clean one-liner instead of duplicating setup code.

Exciting Use Cases for Local GitHub Actions

Local actions are great for project-specific tasks that you’d otherwise duplicate across multiple workflows. Some examples:

  1. Monorepo Dependency Filtering – Only run jobs for apps/libs that actually changed.
  2. Reusable Security Checks – Centralize audits (npm, yarn, trivy) into one action.
  3. Automated Changelog Generation – Auto-generate and update CHANGELOG.md from commits.
  4. Slack/Teams Notifications – Send consistent, branded build/deploy alerts.
  5. Custom Preview Environments – Spin up ephemeral environments (e.g., Vercel/Netlify/containers) for each PR.
  6. Standardized Code Quality Gates – Bundle linting, formatting, and type-checks into one action for consistency across workflows.

Here is a small (for now) local-action-toolbox, that has some demos.

Why Use Local Actions?

✅ DRY (Don’t Repeat Yourself): No more copy-pasting steps.

✅ Clarity: Workflows are more streamlined and readable.

✅ Flexibility: Inputs let you toggle behavior (like installDeps: false).

Wrap-Up

Local GitHub Actions are a small investment that can pay off in a big way. They help keep workflows clean, reduce copy-paste drift, and turn repetitive steps into simple, reusable building blocks.

So the next time you spot the same steps repeated across multiple workflows, think about wrapping them into a local action. It’s one of those moves your future self—and your teammates—will definitely appreciate.


This content originally appeared on DEV Community and was authored by CodeNameGrant