Interview Prep/GitHub Actions/Custom Actions & Reusable Workflows

How do you test a custom action before releasing it?

IntermediateConceptCustom Actions & Reusable Workflows
Answer

Unit-test the logic (Jest or node --test, mocking @actions/core inputs via INPUT_* env vars), then an integration workflow in the action's repo that uses the action locally:

- uses: actions/checkout@v4
- id: self
  uses: ./
  with:
    path: test/fixtures
- run: test "${{ steps.self.outputs.result }}" = "ok"

Run it on a matrix of ubuntu, windows, macos if it claims cross-platform support. nektos/act helps for fast local iteration but is not a full replacement for real runners.

All GitHub Actions questions Roadmap: GitHub Actions

More on Custom Actions & Reusable Workflows