Giter Site home page Giter Site logo

uolevi's Introduction

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

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

$ npm install

Build the typescript and package it for distribution

$ npm run build && npm run package

Run the tests ✔️

$ npm test

 PASS  ./index.test.js
  ✓ throws invalid number (3ms)
  ✓ wait 500 ms (504ms)
  ✓ test runs (95ms)

...

Change action.yml

The action.yml 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

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)

uses: ./
with:
  milliseconds: 1000

See the actions tab for runs of this action! 🚀

Usage:

After testing you can create a v1 tag to reference the stable and latest V1 action

uolevi's People

Contributors

tatupesonen avatar dependabot[bot] avatar alzzu avatar

Watchers

 avatar

Forkers

alzzu

uolevi's Issues

03-05-2022

Commits between 30-04-2022 - 03-05-2022:

Commit message
(#75"}) chore(deps-dev): bump @typescript-eslint/parser from 5.8.1 to 5.22.0 ( ...

15-02-2022

Commits between 15-02-2022 - 15-02-2022:

Commit message

17-03-2022

Commits between 14-03-2022 - 17-03-2022:

Commit message
(#49) fix: remove quote (#49)
(No issue) fix: retry
(No issue) chore: release 1.1
(No issue) fix: always put issue number first
(No issue) fix: put issue number in the first line

15-02-2022

Commits between 12-02-2022 - 15-02-2022:

Commit message
Create action.yml
chore: release 1.0
prepare: for release
test: filtering 2
test: running on 5 min schedule
test: running on schedule
test: run again
test: again
test: again
feat: modify header
feat: rework table
feat: build
feat: test
feat: rerun action
feat: update files
feat: try a table
feat: update action
fix: update workflows and action
fix: retry
fix: retry
fix: update workflows
fix: change node version in check-dist
test: again
fix: refresh build
feat: move to npm
fix: update
test: action
feat: add updated files
feat: begin
Merge pull request #3 from tatupesonen/dependabot/npm_and_yarn/types/n ...

17-03-2022

Commits between 14-03-2022 - 17-03-2022:

Commit message
fix: put issue number in the first line

15-02-2022

Commits between 12-02-2022 - 15-02-2022:

Commit message
chore: release 1.0
prepare: for release
test: filtering 2
test: running on 5 min schedule
test: running on schedule
test: run again
test: again
test: again
feat: modify header
feat: rework table
feat: build
feat: test
feat: rerun action
feat: update files
feat: try a table
feat: update action
fix: update workflows and action
fix: retry
fix: retry
fix: update workflows
fix: change node version in check-dist
test: again
fix: refresh build
feat: move to npm
fix: update
test: action
feat: add updated files
feat: begin
Merge pull request #3 from tatupesonen/dependabot/npm_and_yarn/types/n ...
Merge pull request #2 from tatupesonen/dependabot/npm_and_yarn/typescr ...

27-08-2022

Commits between 24-08-2022 - 27-08-2022:

Commit message
(#129) chore(deps-dev): bump @types/node from 17.0.17 to 18.7.13 (#129)
(#130) chore(deps-dev): bump typescript from 4.5.5 to 4.8.2 (#130)

15-02-2022

Commits between 12-02-2022 - 15-02-2022:

Commit message
chore: release 1.0
prepare: for release
test: filtering 2
test: running on 5 min schedule
test: running on schedule
test: run again
test: again
test: again
feat: modify header
feat: rework table
feat: build
feat: test
feat: rerun action
feat: update files
feat: try a table
feat: update action
fix: update workflows and action
fix: retry
fix: retry
fix: update workflows
fix: change node version in check-dist
test: again
fix: refresh build
feat: move to npm
fix: update
test: action
feat: add updated files
feat: begin
Merge pull request #3 from tatupesonen/dependabot/npm_and_yarn/types/n ...
Merge pull request #2 from tatupesonen/dependabot/npm_and_yarn/typescr ...

15-02-2022

Commits between 15-02-2022 - 15-02-2022:

Commit message
test: filtering 2
test: running on 5 min schedule

27-08-2022

Commits between 24-08-2022 - 27-08-2022:

Commit message
(#130) chore(deps-dev): bump typescript from 4.5.5 to 4.8.2 (#130)

27-08-2022

Commits between 24-08-2022 - 27-08-2022:

Commit message
(#125) chore(deps-dev): bump eslint-plugin-jest from 25.3.2 to 26.8.7 (#125)
(#129) chore(deps-dev): bump @types/node from 17.0.17 to 18.7.13 (#129)
(#130) chore(deps-dev): bump typescript from 4.5.5 to 4.8.2 (#130)

17-03-2022

Commits between 14-03-2022 - 17-03-2022:

Commit message
(No issue) fix: retry
(No issue) chore: release 1.1
(No issue) fix: always put issue number first
(No issue) fix: put issue number in the first line

15-02-2022

Commits between 12-02-2022 - 15-02-2022:

Commit message
feat: add versioning
Update action.yml
feat: build v1.0.1
feat: allow changing branch
Create action.yml
chore: release 1.0
prepare: for release
test: filtering 2
test: running on 5 min schedule
test: running on schedule
test: run again
test: again
test: again
feat: modify header
feat: rework table
feat: build
feat: test
feat: rerun action
feat: update files
feat: try a table
feat: update action
fix: update workflows and action
fix: retry
fix: retry
fix: update workflows
fix: change node version in check-dist
test: again
fix: refresh build
feat: move to npm
fix: update

15-02-2022

Commits between 12-02-2022 - 15-02-2022:

Commit message
Create action.yml
chore: release 1.0
prepare: for release
test: filtering 2
test: running on 5 min schedule
test: running on schedule
test: run again
test: again
test: again
feat: modify header
feat: rework table
feat: build
feat: test
feat: rerun action
feat: update files
feat: try a table
feat: update action
fix: update workflows and action
fix: retry
fix: retry
fix: update workflows
fix: change node version in check-dist
test: again
fix: refresh build
feat: move to npm
fix: update
test: action
feat: add updated files
feat: begin
Merge pull request #3 from tatupesonen/dependabot/npm_and_yarn/types/n ...

15-02-2022

Commits between 12-02-2022 - 15-02-2022:

Commit message
feat: allow changing branch
Create action.yml
chore: release 1.0
prepare: for release
test: filtering 2
test: running on 5 min schedule
test: running on schedule
test: run again
test: again
test: again
feat: modify header
feat: rework table
feat: build
feat: test
feat: rerun action
feat: update files
feat: try a table
feat: update action
fix: update workflows and action
fix: retry
fix: retry
fix: update workflows
fix: change node version in check-dist
test: again
fix: refresh build
feat: move to npm
fix: update
test: action
feat: add updated files
feat: begin

17-03-2022

Commits between 14-03-2022 - 17-03-2022:

Commit message
(#49) fix: remove quote (#49)
(No issue) fix: retry
(No issue) chore: release 1.1
(No issue) fix: always put issue number first
(No issue) fix: put issue number in the first line

17-03-2022

Commits between 14-03-2022 - 17-03-2022:

Commit message
fix: always put issue number first
fix: put issue number in the first line

02-11-2022

Commits between 30-10-2022 - 02-11-2022:

Commit message
(#144) fix: remove unneeded character (#144)

15-02-2022

Commits between 12-02-2022 - 15-02-2022:

Commit message
feat: build v1.0.1
feat: allow changing branch
Create action.yml
chore: release 1.0
prepare: for release
test: filtering 2
test: running on 5 min schedule
test: running on schedule
test: run again
test: again
test: again
feat: modify header
feat: rework table
feat: build
feat: test
feat: rerun action
feat: update files
feat: try a table
feat: update action
fix: update workflows and action
fix: retry
fix: retry
fix: update workflows
fix: change node version in check-dist
test: again
fix: refresh build
feat: move to npm
fix: update
test: action
feat: add updated files

15-02-2022

Commits between 15-02-2022 - 15-02-2022:

Commit message
prepare: for release

15-02-2022

Commits between 12-02-2022 - 15-02-2022:

Commit message
Update action.yml
feat: build v1.0.1
feat: allow changing branch
Create action.yml
chore: release 1.0
prepare: for release
test: filtering 2
test: running on 5 min schedule
test: running on schedule
test: run again
test: again
test: again
feat: modify header
feat: rework table
feat: build
feat: test
feat: rerun action
feat: update files
feat: try a table
feat: update action
fix: update workflows and action
fix: retry
fix: retry
fix: update workflows
fix: change node version in check-dist
test: again
fix: refresh build
feat: move to npm
fix: update
test: action

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.