Video Thumbnail for Lesson
8.1: Developer Experience (Actions)

Developer Experience (Actions)

To improve the Developer Experience when working with GitHub actions we will focus on practices that:

  • Shorten the feedback loop: Run actions and workflows locally so you can validate changes before pushing to GitHub.
  • Improve observability: Capture enough context—logs, environment variables, and even breakpoints—to understand failures quickly.

Iterate on Actions

Run actions with @github/local-action

When behavior depends on the GitHub Actions runtime, use the @github/local-action CLI.

This gives you quick, reproducible runs without pushing branches or waiting for hosted runners.

The npm local-action script for the TypeScript action in module 6 uses this:

  "scripts": {
    "local-action": "npx @github/local-action . src/main.ts .env",
  },

The .env file enables settig the desired configuration and passing inputs. Inputs must be set using all caps snake case:

# inputs.milliseconds is set using:
INPUT_MILLISECONDS=2400

Write tests

Treat actions like any other codebase: add unit tests and run them locally.

The npm test script for the TypeScript action in module 6 executes its Jest test suite with the node flags required by GitHub's TypeScript starter template:

  "scripts": {
    "test": "NODE_OPTIONS=--experimental-vm-modules NODE_NO_WARNINGS=1 npx jest",
  },

Tests are the fastest way to assert success paths and guard against regressions without involving GitHub runners.