Use this template to bootstrap the creation of a TypeScript action.:rocket:
This template includes compilation support, tests, a validation workflow, publishing, and versioning guidance.
If you are new, there's also a simpler introduction. See the Hello World JavaScript Action
Click the Use this Template
and provide the new repo details for your action
Install the dependencies
$ npm install
Build the typescript and package it for distribution
$ npm run build && npm run package
Actions are run from GitHub repos so we will checkin the packed dist folder.
Then run ncc and push the results:
$ npm run package
$ git add dist
$ git commit -a -m "prod dependencies"
$ git push origin releases/v1
Note: We recommend using the --license
option for ncc, which will create a license file for all of the production node modules used in your project.
Your action is now published! 🚀
See the versioning documentation
You can now validate the action by referencing ./
in a workflow in your repo (see test.yml)
test: # make sure the action works on a clean machine without building
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./
with:
repo: ${{ github.repository }}
pull_request_id: ${{github.event.issue.number}}
text: 'Whats up ${{matrix.os}} ${{matrix.node-version}}'
matrix_os: ${{matrix.os}}
matrix_node: ${{matrix.node-version}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}