No description
  • TypeScript 96.8%
  • JavaScript 3.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-05-08 22:31:16 -04:00
.github Update URL 2026-01-16 13:42:20 -05:00
.vscode feat: add Copilot instructions and configuration files 2025-07-18 12:58:44 -04:00
__fixtures__ Update fixture action dependencies 2026-01-16 12:32:17 -05:00
__tests__ Update eslint and remove unused dependencies 2026-02-18 12:44:03 -05:00
badges Fix check for package.json path 2025-03-11 12:07:13 -04:00
bin Drop bootstrap script into run.ts 2025-08-26 15:41:31 -04:00
docs Initial @actions/cache stub implementation 2025-09-10 16:05:35 -04:00
src Copilot nits 2026-02-18 14:09:16 -05:00
.checkov.yml Add checkov ignore 2024-03-01 10:30:36 -05:00
.env.example Update @actions/artifact stubs 2026-01-16 12:09:33 -05:00
.gitignore Update Linter and Fix Vulnerable Dependency (#121) 2024-11-21 13:24:22 -05:00
.grype.yml fix: update ignore configuration for stdlib package to specify type 2025-08-27 15:20:49 -04:00
.markdown-lint.yml Move and update config files 2024-02-08 13:04:53 -05:00
.mega-linter.yml Fix lint script to use installed prettier version 2026-01-05 14:33:07 -05:00
.node-version Update node version 2026-01-16 13:53:32 -05:00
.prettierignore Update prettier config 2024-02-15 13:23:55 -05:00
.prettierrc.yml Update prettier config 2024-02-15 13:23:55 -05:00
.yaml-lint.yml Move and update config files 2024-02-08 13:04:53 -05:00
CHANGELOG.md Update supported package versions 2026-01-16 12:04:53 -05:00
CODE_OF_CONDUCT.md Add initial code of conduct 2023-10-26 10:58:46 -04:00
CODEOWNERS Add initial CODEOWNERS 2023-10-26 11:03:27 -04:00
CONTRIBUTING.md Update GitHub Actions Toolkit stubs and dependencies 2025-09-10 12:10:01 -04:00
eslint.config.mjs Copilot nits 2026-02-18 14:09:16 -05:00
jest.config.ts Update eslint and remove unused dependencies 2026-02-18 12:44:03 -05:00
LICENSE Add MIT license 2023-10-26 11:02:16 -04:00
package-lock.json Build(deps-dev): Bump handlebars from 4.7.8 to 4.7.9 2026-03-27 21:14:57 +00:00
package.json Copilot nits 2026-02-18 14:09:16 -05:00
README.md Update supported package versions 2026-01-16 12:04:53 -05:00
SECURITY.md Add initial security policy 2023-10-26 10:57:32 -04:00
SUPPORT.md Update support info 2024-02-15 13:27:27 -05:00
tsconfig.base.json Expand unit test coverage 2025-04-03 13:35:16 -04:00
tsconfig.eslint.json Add pre and post support to run command 2025-07-07 15:39:13 -04:00
tsconfig.json Add Support for ESM Actions (#90) 2024-08-22 17:38:24 -04:00

Local Action Debugger

GitHub Super-Linter Continuous Integration Code Coverage

Run custom GitHub Actions locally and test them in Visual Studio Code!

This command-line tool emulates some basic functionality of the GitHub Actions Toolkit so that custom actions can be run directly on your workstation.

Note

This tool currently only supports JavaScript and TypeScript actions!

The following table tracks the versions of the GitHub Actions Toolkit that are currently implemented by this tool.

Package Version
@actions/artifact 5.0.2
@actions/cache 5.0.3
@actions/core 2.0.2
@actions/github 7.0.0

Changelog

See the CHANGELOG for a complete list of changes.

Node.js Version Support

This tool is currently tested against Node.js versions 22 and 24. It is not guaranteed to work with other versions at this time.

Package Manager Support

npm Support

This tool is designed primarily for use with npm and npx. It is recommended to use npm for managing actions you wish to test with this tool.

pnpm Support

This tool ships with experimental support for pnpm. If you encounter any issues, please file an issue.

Some caveats to this support are listed below.

  • This tool does not support CommonJS actions using pnpm.

yarn Support

This tool ships with experimental support for yarn. If you encounter any issues, please file an issue.

Some caveats to this support are listed below.

  • The @github/local-action package should be run using yarn dlx @github/local-action instead of yarn local-action.
  • This tool does not support CommonJS actions using yarn.

Prerequisites

Installed Tools

Action Structure

For JavaScript and TypeScript actions, your code should follow the format of the corresponding template repository.

Specifically, there should be a separation between the entrypoint used by GitHub Actions when invoking your code, and the actual logic of your action. For example:

Entrypoint: index.ts

This is what is invoked by GitHub Actions when your action is run.

/**
 * This file is the entrypoint for the action
 */
import { run } from './main'

// It calls the actual logic of the action
run()

Logic: main.ts

This is the actual implementation of your action. It is called by the entrypoint.

import * as core from '@actions/core'
import { wait } from './wait'

/**
 * This file is the actual logic of the action
 * @returns {Promise<void>} Resolves when the action is complete
 */
export async function run(): Promise<void> {
  // ...
}

Transpiled Actions

Depending on how you build your JavaScript/TypeScript actions, you may do one of the following when preparing for release:

  • Commit the node_modules directory to your repository
  • Transpile your code and dependencies using tools like tsc, @vercel/ncc, or rollup

This tool supports non-transpiled action code only. This is because it uses quibble to override GitHub Actions Toolkit dependencies (e.g @actions/core). In transpiled code, this simply doesn't work.

For example, if you have a TypeScript action that follows the same format as the template, you would have both src and dist directories in your repository. The dist directory contains the transpiled code with any dependencies included. When running this utility, you will want to target the code files in the src directory instead (including the dependencies this tool wants to replace). This has the added benefit of being able to hook into debugging utilities in your IDE 🎉

For additional information about transpiled action code, see Commit, tag, and push your action to GitHub.

Installation

Option 1: Install from npm

  1. Install via npm

    npm i -g @github/local-action
    

Option 2: Clone this Repository

  1. Clone this repository locally

    git clone https://github.com/github/local-action.git
    
  2. Install dependencies

    npm ci
    
  3. Install via npm

    npm i -g .
    

    Alternatively, you can link the package if you want to make code changes

    npm link .
    

Commands

local-action

Option Description
-h, --help Display help information
-V, --version Display version information

local-action run <path> <logic entrypoint> <dotenv file> [--pre <pre entrypoint>] [--post <post entrypoint>]

Argument Description
path Path to the local action directory
Example: /path/to/action.yml
logic entrypoint Action logic entrypoint (relative to action directory)
Example: src/main.ts
dotenv file Path to the local .env file for action inputs
Example: /path/to/.env
See the example .env.example
--pre <pre entrypoint> (Optional) pre command entrypoint (relative to action directory)
Example: pre/main.ts
--post <post entrypoint> (Optional) post command entrypoint (relative to action directory)
Example: post/main.ts

Examples:

local-action run /path/to/typescript-action src/main.ts .env --pre pre/main.ts --post post/main.ts

# The `run` action is invoked by default as well
local-action /path/to/typescript-action src/main.ts .env --pre pre/main.ts --post post/main.ts

Output

$ local-action run /path/to/typescript-action src/main.ts .env --pre pre/main.ts --post post/main.ts
     _        _   _               ____       _
    / \   ___| |_(_) ___  _ __   |  _ \  ___| |__  _   _  __ _  __ _  ___ _ __
   / _ \ / __| __| |/ _ \| '_ \  | | | |/ _ \ '_ \| | | |/ _` |/ _` |/ _ \ '__|
  / ___ \ (__| |_| | (_) | | | | | |_| |  __/ |_) | |_| | (_| | (_| |  __/ |
 /_/   \_\___|\__|_|\___/|_| |_| |____/ \___|_.__/ \__,_|\__, |\__, |\___|_|
                                                         |___/ |___/
================================================================================
                                 Configuration
================================================================================

┌─────────┬────────────────────┬───────────────────────────────────────────┐
│ (index) │       Field        │                  Value                    │
├─────────┼────────────────────┼───────────────────────────────────────────┤
│    0    │   'Action Path'    │       '/path/to/typescript-action'        │
│    1    │    'Entrypoint'    │ '/path/to/typescript-action/src/main.ts'  │
│    2    │ 'Environment File' │   '/path/to/local-action-debugger/.env'   │
└─────────┴────────────────────┴───────────────────────────────────────────┘

================================================================================
                                Action Metadata
================================================================================

┌─────────┬────────────────┬───────────────────────────────┐
│ (index) │     Input      │          Description          │
├─────────┼────────────────┼───────────────────────────────┤
│    0    │ 'milliseconds' │ 'Your input description here' │
└─────────┴────────────────┴───────────────────────────────┘

┌─────────┬────────┬────────────────────────────────┐
│ (index) │ Output │          Description           │
├─────────┼────────┼────────────────────────────────┤
│    0    │ 'time' │ 'Your output description here' │
└─────────┴────────┴────────────────────────────────┘

================================================================================
                                 Running Action
================================================================================

(TypeScript) TSConfig Requirements

If you are testing TypeScript actions, there are a few settings that must be configured in your tsconfig.json file (either explicitly or via their default values).

Property Required Value
allowJs false

Troubleshooting

Possible errors that can arise from not having allowJs: false:

  • TypeError [ERR_INVALID_URL_SCHEME]: The URL must be of scheme file from tsx when trying to run npx @github/local-action.

Features

The following list links to documentation on how to use various features of the local-action tool.