Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/NickLiffen/actions-boilerplate
Sample Typescript Actions Template
https://github.com/NickLiffen/actions-boilerplate
Last synced: 3 months ago
JSON representation
Sample Typescript Actions Template
- Host: GitHub
- URL: https://github.com/NickLiffen/actions-boilerplate
- Owner: NickLiffen
- Created: 2021-11-22T15:35:34.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-01T10:34:13.000Z (7 months ago)
- Last Synced: 2024-07-08T11:22:32.654Z (7 months ago)
- Language: Shell
- Size: 455 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-ccamel - NickLiffen/actions-boilerplate - Sample Typescript Actions Template (Shell)
README
# GitHub Actions Boilerplate
## Introduction
A sample GitHub action boilerplate for Typescript actions.
It comes with:
- **Node 16 Support**: Current LTS.
- **ESlint and Prettier**: Code quality and consistency tooling.
- **Husky**: Pre-commit hook ensuring code is built before being deployed to GitHub.There are many open source actions boilerplates/templates. I use this one as I try and keep it up to date and simplistic.
## Getting Started
Click [Use this template](https://github.com/NickLiffen/actions-boilerplate/generate) on this repository. Enter in your action repository name and description, and click *Create repository from template*.
Close down locally, and run:
```sh
yarn install --frozen-lockfile && yarn run build
```Edit the required fields within the `package.json` and `action.yml` and you should be good to go. Simply start writing code within the `src` directory.
## Testing Locally
We use [act](https://github.com/nektos/act) to test our actions locally. If you are interested in testing your action locally, you will need to do a few things:
1. Create a `my.secrets` file. This file will contain all the secrets required in your workflow to test this action.
2. Create a `.env.` within the root of this repository. This file will contain any environment variables required in your workflow to test this action.
3. Update the `.github/workflows/regression.yml` file to test your action. This will include updating any `events` in the workflow and inputs.
4. Update the `.github/workflows/regression/payload.yml` file, which contains the input payload for your action.Once you have done the above, you are ready to test locally and run `yarn run local`. This will trigger `act` to run your workflow and, therefore, your action.
For more information on how to use act, see the instructions here: [Act Overview](https://github.com/nektos/act/blob/master/README.md).
## Contributing?
Simply raise a pull request :) Make sure CI passes and then you should be good to go.