Skip to content

Commit

Permalink
Improve readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip Harrison committed Jul 21, 2021
1 parent 904dc1f commit 7e9f47c
Showing 1 changed file with 12 additions and 24 deletions.
36 changes: 12 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,21 @@
<p align="center">
<a href="https://github.com/actions/typescript-action/actions"><img alt="typescript-action status" src="https://github.com/actions/typescript-action/workflows/build-test/badge.svg"></a>
</p>

# 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](https://github.com/actions/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
## Setup

> First, you'll need to have a reasonably modern version of `node` handy. This won't work with versions older than 9, for instance.
Install the dependencies
Install the dependencies

```bash
$ npm install
```

Build the typescript and package it for distribution

```bash
$ npm run build && npm run package
$ npm run package
```

Run the tests :heavy_check_mark:
Run the tests :heavy_check_mark:

```bash
$ npm test

Expand Down Expand Up @@ -57,9 +44,9 @@ import * as core from '@actions/core';
...

async function run() {
try {
try {
...
}
}
catch (error) {
core.setFailed(error.message);
}
Expand All @@ -72,9 +59,10 @@ See the [toolkit documentation](https://github.com/actions/toolkit/blob/master/R

## Publish to a distribution branch

Actions are run from GitHub repos so we will checkin the packed dist folder.
Actions are run from GitHub repos so we will checkin the packed dist folder.

Then run [ncc](https://github.com/zeit/ncc) and push the results:

```bash
$ npm run package
$ git add dist
Expand All @@ -84,7 +72,7 @@ $ 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! :rocket:
Your action is now published! :rocket:

See the [versioning documentation](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md)

Expand Down

0 comments on commit 7e9f47c

Please sign in to comment.