👋 Starter template with the action layout, linting, CI, and publishing pre-configured
A complete GitHub Action starter template that includes:
- ✅ Action boilerplate with inputs/outputs
- ✅ ESLint configuration for code quality
- ✅ Jest testing framework with sample tests
- ✅ GitHub Actions CI/CD workflow
- ✅ Automated bundling with ncc
- ✅ Example implementation that works out of the box
- ✅ GitHub REST API integration with Octokit
- ✅ Repository statistics fetching example
- Click "Use this template" to create a new repository
- Clone your new repository locally
- Run
npm installto install dependencies
📋 See TEMPLATE_CHECKLIST_DELETE_ME.md for a comprehensive customization guide
- Update
package.jsonwith your action name and details - Update
action.ymlwith your action's inputs and outputs - Modify
src/index.jswith your action logic - Update this README with your action's documentation
- Update the publish workflow if needed
npm test # Run tests
npm run lint # Check code quality with ESLint
npm run format:write # Run Prettier for formatting
npm run coverage # Generate coverage badge
npm run package # Bundle for distribution
npm run all # Alternatively: Run format, lint, test, coverage, and package- name: Hello World Action
uses: your-username/your-action-name@v1
with:
who-to-greet: 'World'
include-time: true
message-prefix: 'Hello'
github-token: ${{ secrets.GITHUB_TOKEN }} # Optional: for repo stats| Input | Description | Required | Default |
|---|---|---|---|
who-to-greet |
Who to greet in the message | No | 'World' |
include-time |
Whether to include current time in output | No | false |
message-prefix |
Prefix for the greeting message | No | 'Hello' |
github-token |
GitHub token for API access (enables repo stats) | No | - |
| Output | Description |
|---|---|
message |
The generated greeting |
time |
Current timestamp (if requested) |
repo-stats |
Repository statistics JSON (if token provided) |
This template includes everything you need to start developing GitHub Actions:
- Clone this repository
- Install dependencies:
npm install - Make your changes to
src/index.js - Run tests:
npm test - Build the action:
npm run package
npm test- Run Jest testsnpm run lint- Run ESLintnpm run format:write- Format code with Prettiernpm run package- Bundle the action with nccnpm run all- Run format, lint, test, coverage, and package
You can test the action locally by setting environment variables:
export INPUT_WHO_TO_GREET="Local Dev"
export INPUT_INCLUDE_TIME="true"
export INPUT_MESSAGE_PREFIX="Hey"
node src/index.js├── src/
│ └── index.js # Main action code
├── __tests__/
│ └── index.test.js # Jest tests
├── dist/ # Bundled action (generated)
├── action.yml # Action metadata
├── package.json # Dependencies and scripts
└── README.md # This file