# What Is the Entry Point for actions/checkout?

> Discover the entry point for actions/checkout: dist/index.js. Learn where the development source resides and find the main file specified in action.yml for your CI/CD workflows.

- Repository: [GitHub Actions/checkout](https://github.com/actions/checkout)
- Tags: getting-started
- Published: 2026-07-05

---

**The entry point for actions/checkout is [`dist/index.js`](https://github.com/actions/checkout/blob/main/dist/index.js), specified in [`action.yml`](https://github.com/actions/checkout/blob/main/action.yml) as `runs.main`, while the development source is [`src/main.ts`](https://github.com/actions/checkout/blob/main/src/main.ts).**

The `actions/checkout` repository is a compiled Node.js action that GitHub workflows invoke to clone repositories. Understanding its entry point architecture is essential for debugging workflow failures, contributing to the codebase, or invoking the action programmatically. The action uses a dual-entry structure where the runtime executes compiled JavaScript while developers work with TypeScript source.

## Runtime vs. Source Entry Points

### Compiled Runtime ([`dist/index.js`](https://github.com/actions/checkout/blob/main/dist/index.js))

The actual file executed by the GitHub Actions runner is **[`dist/index.js`](https://github.com/actions/checkout/blob/main/dist/index.js)**. According to the repository source, this bundled JavaScript file contains all dependencies and serves as the runtime entry point. When a workflow calls `uses: actions/checkout@v4`, the runner loads this specific file to begin execution.

### TypeScript Source ([`src/main.ts`](https://github.com/actions/checkout/blob/main/src/main.ts))

During development, the primary entry point is **[`src/main.ts`](https://github.com/actions/checkout/blob/main/src/main.ts)**. This module contains all initialization logic, including parsing inputs, configuring Git, performing the checkout, and handling optional post-run cleanup. The build process compiles this TypeScript file into the distribution bundle found in [`dist/index.js`](https://github.com/actions/checkout/blob/main/dist/index.js).

## Configuration in [`action.yml`](https://github.com/actions/checkout/blob/main/action.yml)

The **[`action.yml`](https://github.com/actions/checkout/blob/main/action.yml)** metadata file defines the runtime entry point explicitly. Lines 15-18 of the configuration declare:

- `runs.main: dist/index.js` – executes the main checkout logic
- `runs.post: dist/index.js` – executes the post-run cleanup

This metadata bridges the gap between the repository code and the GitHub Actions runner, ensuring the correct file is invoked at workflow runtime.

## How the Entry Point Executes

### Workflow Invocation

When referenced in a workflow, the runner automatically invokes the configured entry point:

```yaml

# .github/workflows/example.yml

name: Example workflow
on: push
jobs:
  checkout:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4   # invokes dist/index.js

        with:
          fetch-depth: 0          # fetch full history

          lfs: true               # download Git-LFS files

```

### Programmatic Invocation

You can also invoke the entry point directly from Node.js applications:

```javascript
// example-node.js
const checkout = require('@actions/checkout/dist/index.js');
// invoke the exported run function
checkout.run();

```

## Core Initialization Logic

The **[`src/main.ts`](https://github.com/actions/checkout/blob/main/src/main.ts)** module orchestrates the entire checkout process. It imports helper modules such as [`src/input-helper.ts`](https://github.com/actions/checkout/blob/main/src/input-helper.ts) for parsing workflow inputs and [`src/git-command-manager.ts`](https://github.com/actions/checkout/blob/main/src/git-command-manager.ts) for executing Git commands. When compiled, this logic is bundled into [`dist/index.js`](https://github.com/actions/checkout/blob/main/dist/index.js) to create the self-contained runtime entry point that handles repository cloning, submodules, and authentication.

## Summary

- The **runtime entry point** is [`dist/index.js`](https://github.com/actions/checkout/blob/main/dist/index.js), as defined in [`action.yml`](https://github.com/actions/checkout/blob/main/action.yml) under `runs.main` and `runs.post`.
- The **development source entry point** is [`src/main.ts`](https://github.com/actions/checkout/blob/main/src/main.ts), which handles initialization, input parsing, and Git orchestration.
- The **[`action.yml`](https://github.com/actions/checkout/blob/main/action.yml)** metadata file determines which file the GitHub Actions runner executes.
- You can invoke the entry point programmatically by requiring the compiled module and calling the `run()` function.

## Frequently Asked Questions

### What file does GitHub Actions actually execute when I use actions/checkout?

The runner executes **[`dist/index.js`](https://github.com/actions/checkout/blob/main/dist/index.js)**, which is specified in [`action.yml`](https://github.com/actions/checkout/blob/main/action.yml) as the `runs.main` entry point. This is a compiled, bundled JavaScript file that includes all dependencies and the core logic from [`src/main.ts`](https://github.com/actions/checkout/blob/main/src/main.ts).

### How do I invoke the checkout action programmatically from Node.js?

You can require the compiled module directly from your Node.js application using `const checkout = require('@actions/checkout/dist/index.js')`, then invoke `checkout.run()` to execute the same entry point used by workflows.

### Why is the entry point in a `dist` folder instead of `src`?

GitHub Actions executes compiled JavaScript for performance and bundling reasons. The `src` folder contains TypeScript source code that must be compiled and bundled into [`dist/index.js`](https://github.com/actions/checkout/blob/main/dist/index.js) before distribution, ensuring the action runs without requiring TypeScript compilation in the workflow environment.

### What function handles the main logic inside the entry point?

The **`run()`** function exported from the entry point (defined in [`src/main.ts`](https://github.com/actions/checkout/blob/main/src/main.ts) and compiled into [`dist/index.js`](https://github.com/actions/checkout/blob/main/dist/index.js)) handles the primary logic, including input parsing, Git configuration, and repository checkout.