Skip to content

Latest commit

 

History

History
112 lines (81 loc) · 2.37 KB

File metadata and controls

112 lines (81 loc) · 2.37 KB

Build a JavaScript Action using TypeScript

The project is based on the template actions/typescript-action: Create a TypeScript Action with tests, linting, workflow, publishing, and versioning

Code in Main branch

Install the dependencies

npm install

Build & test

npm run all

Change action.yml

The action.yml contains defines the inputs and output for your action.

Update the action.yml with your name, description, inputs and outputs for your action.

See the documentation

Change the Code

Most toolkit and CI/CD operations involve async operations so the action is run in an async function.

import * as core from '@actions/core';
...

async function run() {
  try {
      ...
  }
  catch (error) {
    core.setFailed(error.message);
  }
}

run()

See the toolkit documentation for the various packages.

Publish to a distribution branch

# update the version in package.json
# commit the change
git commit -a -m "📦"
script/release

Your action is now published! 🚀

See the versioning documentation

Validate

You can now validate the action by referencing the releases/v1 branch

uses: actions/typescript-action@releases/v1
with:
  milliseconds: 1000

See the actions tab for runs of this action! 🚀

Notify Marketplace of the new version

Edit tag on GitHub: https://github.com/davidB/rust-cargo-make/releases/new?tag=v1.5.0