{"id":13406097,"url":"https://github.com/github/local-action","last_synced_at":"2026-02-18T21:15:03.780Z","repository":{"id":203781413,"uuid":"710362500","full_name":"github/local-action","owner":"github","description":"A simple utility for running and debugging a GitHub Action locally","archived":false,"fork":false,"pushed_at":"2025-05-02T15:19:43.000Z","size":2247,"stargazers_count":264,"open_issues_count":5,"forks_count":14,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-05-14T11:51:47.970Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/github.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-10-26T14:43:28.000Z","updated_at":"2025-05-07T08:43:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"e3d0985d-c7c3-4dd9-98ca-8a1f448efe6e","html_url":"https://github.com/github/local-action","commit_stats":{"total_commits":177,"total_committers":3,"mean_commits":59.0,"dds":0.3389830508474576,"last_synced_commit":"905935ee4ea906d05caa4a53ed3c202e4f6ccaf3"},"previous_names":["github/local-action"],"tags_count":63,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Flocal-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Flocal-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Flocal-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Flocal-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/github","download_url":"https://codeload.github.com/github/local-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254319715,"owners_count":22051072,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T19:02:20.841Z","updated_at":"2026-02-18T21:15:03.766Z","avatar_url":"https://github.com/github.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Local Action Debugger\n\n![GitHub Super-Linter](https://github.com/github/local-action/actions/workflows/linter.yml/badge.svg)\n![Continuous Integration](https://github.com/github/local-action/actions/workflows/continuous-integration.yml/badge.svg)\n![Code Coverage](badges/coverage.svg)\n\nRun custom GitHub Actions locally and test them in Visual Studio Code!\n\nThis command-line tool emulates some **basic** functionality of the\n[GitHub Actions Toolkit](https://github.com/actions/toolkit) so that custom\nactions can be run directly on your workstation.\n\n\u003e [!NOTE]\n\u003e\n\u003e This tool currently only supports JavaScript and TypeScript actions!\n\nThe following table tracks the versions of the GitHub Actions Toolkit that are\ncurrently implemented by this tool.\n\n| Package                                                                | Version |\n| ---------------------------------------------------------------------- | ------- |\n| [`@actions/artifact`](https://www.npmjs.com/package/@actions/artifact) | `5.0.2` |\n| [`@actions/cache`](https://www.npmjs.com/package/@actions/cache)       | `5.0.3` |\n| [`@actions/core`](https://www.npmjs.com/package/@actions/core)         | `2.0.2` |\n| [`@actions/github`](https://www.npmjs.com/package/@actions/github)     | `7.0.0` |\n\n## Changelog\n\nSee the [CHANGELOG](./CHANGELOG.md) for a complete list of changes.\n\n## Node.js Version Support\n\nThis tool is currently tested against **Node.js versions 22 and 24**. It is not\nguaranteed to work with other versions at this time.\n\n## Package Manager Support\n\n### `npm` Support\n\nThis tool is designed primarily for use with `npm` and `npx`. It is recommended\nto use `npm` for managing actions you wish to test with this tool.\n\n### `pnpm` Support\n\nThis tool ships with **experimental** support for `pnpm`. If you encounter any\nissues, please [file an issue](https://github.com/github/local-action/issues).\n\nSome caveats to this support are listed below.\n\n- This tool does not support CommonJS actions using `pnpm`.\n\n### `yarn` Support\n\nThis tool ships with **experimental** support for `yarn`. If you encounter any\nissues, please [file an issue](https://github.com/github/local-action/issues).\n\nSome caveats to this support are listed below.\n\n- The `@github/local-action` package should be run using\n  `yarn dlx @github/local-action` instead of `yarn local-action`.\n- This tool does not support CommonJS actions using `yarn`.\n\n## Prerequisites\n\n### Installed Tools\n\n- [Node.js and npm](https://nodejs.org/en)\n\n### Action Structure\n\nFor JavaScript and TypeScript actions, your code should follow the format of the\ncorresponding template repository.\n\n- [`actions/javascript-action`](https://github.com/actions/javascript-action)\n- [`actions/typescript-action`](https://github.com/actions/typescript-action)\n\nSpecifically, there should be a separation between the entrypoint used by GitHub\nActions when invoking your code, and the actual logic of your action. For\nexample:\n\n#### Entrypoint: **`index.ts`**\n\nThis is what is invoked by GitHub Actions when your action is run.\n\n```typescript\n/**\n * This file is the entrypoint for the action\n */\nimport { run } from './main'\n\n// It calls the actual logic of the action\nrun()\n```\n\n#### Logic: **`main.ts`**\n\nThis is the actual implementation of your action. It is called by the\nentrypoint.\n\n```typescript\nimport * as core from '@actions/core'\nimport { wait } from './wait'\n\n/**\n * This file is the actual logic of the action\n * @returns {Promise\u003cvoid\u003e} Resolves when the action is complete\n */\nexport async function run(): Promise\u003cvoid\u003e {\n  // ...\n}\n```\n\n### Transpiled Actions\n\nDepending on how you build your JavaScript/TypeScript actions, you may do one of\nthe following when preparing for release:\n\n- Commit the `node_modules` directory to your repository\n- Transpile your code and dependencies using tools like\n  [`tsc`](https://www.typescriptlang.org/docs/handbook/compiler-options.html),\n  [`@vercel/ncc`](https://www.npmjs.com/package/@vercel/ncc), or\n  [`rollup`](https://rollupjs.org/)\n\n**This tool supports non-transpiled action code only.** This is because it uses\n[`quibble`](https://github.com/testdouble/quibble) to override GitHub Actions\nToolkit dependencies (e.g\n[`@actions/core`](https://www.npmjs.com/package/@actions/core)). In transpiled\ncode, this simply doesn't work.\n\nFor example, if you have a TypeScript action that follows the same format as the\n[template](https://github.com/actions/typescript-action), you would have both\n`src` and `dist` directories in your repository. The `dist` directory contains\nthe transpiled code with any dependencies included. When running this utility,\nyou will want to target the code files in the `src` directory instead (including\nthe dependencies this tool wants to replace). This has the added benefit of\nbeing able to hook into debugging utilities in your IDE :tada:\n\nFor additional information about transpiled action code, see\n[Commit, tag, and push your action to GitHub](https://docs.github.com/en/actions/creating-actions/creating-a-javascript-action#commit-tag-and-push-your-action-to-github).\n\n## Installation\n\n### Option 1: Install from npm\n\n1. Install via `npm`\n\n   ```bash\n   npm i -g @github/local-action\n   ```\n\n### Option 2: Clone this Repository\n\n1. Clone this repository locally\n\n   ```bash\n   git clone https://github.com/github/local-action.git\n   ```\n\n1. Install dependencies\n\n   ```bash\n   npm ci\n   ```\n\n1. Install via `npm`\n\n   ```bash\n   npm i -g .\n   ```\n\n   Alternatively, you can link the package if you want to make code changes\n\n   ```bash\n   npm link .\n   ```\n\n## Commands\n\n### `local-action`\n\n| Option            | Description                 |\n| ----------------- | --------------------------- |\n| `-h`, `--help`    | Display help information    |\n| `-V`, `--version` | Display version information |\n\n### `local-action run \u003cpath\u003e \u003clogic entrypoint\u003e \u003cdotenv file\u003e [--pre \u003cpre entrypoint\u003e] [--post \u003cpost entrypoint\u003e]`\n\n| Argument                   | Description                                                         |\n| -------------------------- | ------------------------------------------------------------------- |\n| `path`                     | Path to the local action directory                                  |\n|                            | Example: `/path/to/action.yml`                                      |\n| `logic entrypoint`         | Action logic entrypoint (relative to action directory)              |\n|                            | Example: `src/main.ts`                                              |\n| `dotenv file`              | Path to the local `.env` file for action inputs                     |\n|                            | Example: `/path/to/.env`                                            |\n|                            | See the example [`.env.example`](.env.example)                      |\n| `--pre \u003cpre entrypoint\u003e`   | (Optional) `pre` command entrypoint (relative to action directory)  |\n|                            | Example: `pre/main.ts`                                              |\n| `--post \u003cpost entrypoint\u003e` | (Optional) `post` command entrypoint (relative to action directory) |\n|                            | Example: `post/main.ts`                                             |\n\nExamples:\n\n```bash\nlocal-action run /path/to/typescript-action src/main.ts .env --pre pre/main.ts --post post/main.ts\n\n# The `run` action is invoked by default as well\nlocal-action /path/to/typescript-action src/main.ts .env --pre pre/main.ts --post post/main.ts\n```\n\n#### Output\n\n```console\n$ local-action run /path/to/typescript-action src/main.ts .env --pre pre/main.ts --post post/main.ts\n     _        _   _               ____       _\n    / \\   ___| |_(_) ___  _ __   |  _ \\  ___| |__  _   _  __ _  __ _  ___ _ __\n   / _ \\ / __| __| |/ _ \\| '_ \\  | | | |/ _ \\ '_ \\| | | |/ _` |/ _` |/ _ \\ '__|\n  / ___ \\ (__| |_| | (_) | | | | | |_| |  __/ |_) | |_| | (_| | (_| |  __/ |\n /_/   \\_\\___|\\__|_|\\___/|_| |_| |____/ \\___|_.__/ \\__,_|\\__, |\\__, |\\___|_|\n                                                         |___/ |___/\n================================================================================\n                                 Configuration\n================================================================================\n\n┌─────────┬────────────────────┬───────────────────────────────────────────┐\n│ (index) │       Field        │                  Value                    │\n├─────────┼────────────────────┼───────────────────────────────────────────┤\n│    0    │   'Action Path'    │       '/path/to/typescript-action'        │\n│    1    │    'Entrypoint'    │ '/path/to/typescript-action/src/main.ts'  │\n│    2    │ 'Environment File' │   '/path/to/local-action-debugger/.env'   │\n└─────────┴────────────────────┴───────────────────────────────────────────┘\n\n================================================================================\n                                Action Metadata\n================================================================================\n\n┌─────────┬────────────────┬───────────────────────────────┐\n│ (index) │     Input      │          Description          │\n├─────────┼────────────────┼───────────────────────────────┤\n│    0    │ 'milliseconds' │ 'Your input description here' │\n└─────────┴────────────────┴───────────────────────────────┘\n\n┌─────────┬────────┬────────────────────────────────┐\n│ (index) │ Output │          Description           │\n├─────────┼────────┼────────────────────────────────┤\n│    0    │ 'time' │ 'Your output description here' │\n└─────────┴────────┴────────────────────────────────┘\n\n================================================================================\n                                 Running Action\n================================================================================\n```\n\n## (TypeScript) TSConfig Requirements\n\nIf you are testing TypeScript actions, there are a few settings that **must** be\nconfigured in your `tsconfig.json` file (either explicitly or via their default\nvalues).\n\n| Property                                                      | Required Value |\n| ------------------------------------------------------------- | -------------- |\n| [`allowJs`](https://www.typescriptlang.org/tsconfig/#allowJs) | `false`        |\n\n### Troubleshooting\n\nPossible errors that can arise from not having `allowJs: false`:\n\n- `TypeError [ERR_INVALID_URL_SCHEME]: The URL must be of scheme file` from tsx\n  when trying to run `npx @github/local-action`.\n\n## Features\n\nThe following list links to documentation on how to use various features of the\n`local-action` tool.\n\n- [Supported Functionality](./docs//supported-functionality.md)\n- [Debugging in Visual Studio Code](./docs/debugging-in-vscode.md)\n- [Create a Job Summary](./docs/create-a-job-summary.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub%2Flocal-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgithub%2Flocal-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub%2Flocal-action/lists"}