Skip to content
This repository has been archived by the owner on Feb 7, 2022. It is now read-only.

Create a TypeScript Action with tests, linting, workflow, publishing, and versioning

License

Notifications You must be signed in to change notification settings

wixplosives/action-publish-pr-comment

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace
 
 

Repository files navigation

typescript-action status

Create a JavaScript Action using TypeScript

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

Create an action from this template

Click the Use this Template and provide the new repo details for your action

Code in Main

Install the dependencies

$ npm install

Build the typescript and package it for distribution

$ npm run build && npm run package

Publish to a distribution branch

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

Validate

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 }}

About

Create a TypeScript Action with tests, linting, workflow, publishing, and versioning

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 93.3%
  • JavaScript 6.7%