Skip to content

Warning

You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?

Prepare local Actions

Actions
Prepare local actions by installing dependencies and building the actions
v1
Pre-release
Star (2)

Tags

 (1)

prepare-local-actions

This action prepares actions defined in the local repository by installing dependencies and building the actions.

Usage

In your workflow:

steps:
- uses: actions/checkout@v2
- uses: JojOatXGME/prepare-local-actions@v1
- uses: ./.github/actions/myLocalAction

In .github/actions/package.json:

{
  "private": true,
  "scripts": {
    "build": "tsc"
  },
  "dependencies": {
    "@actions/core": "^1.2.4",
    "@actions/exec": "^1.0.4"
  },
  "devDependencies": {
    "@types/node": "^12.12.54"
  }
}

In .github/actions/tsconfig.json:

{
  "include": [ "**/*.ts" ],
  "compilerOptions": {
    "rootDir": ".",

    "target": "ES2019",
    "module": "CommonJS",
    "lib": ["ES2019"],
    "forceConsistentCasingInFileNames": true,
    "newLine": "lf",

    "noImplicitReturns": true,
    "strict": true,
    "useDefineForClassFields": true
  }
}

In .github/actions/myLocalAction/action.yml:

name: 'My Local Action'
description: 'Some action defined within the repository.'
runs:
  using: 'node12'
  main: 'index.js'

In .github/actions/myLocalAction/index.ts:

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

async function main() {
    core.info("My Local Action is executed.");
}

main().catch(reason => {
    core.setFailed(reason instanceof Error ? reason : new Error(reason));
});

Prepare local Actions is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Prepare local actions by installing dependencies and building the actions
v1
Pre-release

Tags

 (1)

Prepare local Actions is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.