Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 930 Bytes

File metadata and controls

29 lines (21 loc) · 930 Bytes

single-variable-mapper

GitHub Action that maps a key to a value using regex pattern matching. Used in CI/CD workflows to remap variables (e.g., branch names to environment names).

Project Structure

  • src/main.ts - Core logic: input validation, regex matching, output export
  • src/index.ts - Entrypoint (calls run())
  • action.yml - GitHub Action definition (inputs/outputs)
  • __tests__/main.test.ts - Jest tests with mocked @actions/core
  • dist/ - Compiled bundle (generated by ncc, committed to repo)

Commands

  • npm test - Run tests (Jest)
  • npm run lint - Run all linters (eslint + markdownlint + yamllint)
  • npm run format:write - Format with Prettier
  • npm run package - Bundle with ncc to dist/
  • npm run all - Format + lint + test + coverage + package

Ignore

Ignore generated/compiled code when exploring:

  • dist/ - ncc bundle output
  • node_modules/
  • coverage/
  • badges/