A template to demonstrate how to build a JavaScript action.
Go to file
Nick Alteen a5188c871c
Merge pull request #126 from actions/dependabot/npm_and_yarn/npm-development-b30d547ecb
Bump @vercel/ncc from 0.38.1 to 0.38.2 in the npm-development group
2024-09-23 13:41:27 -04:00
.github Rename checkov file 2024-08-22 11:59:55 -04:00
__tests__ Convert to use src and dist paths 2023-09-15 10:56:32 -04:00
badges Convert to use src and dist paths 2023-09-15 10:56:32 -04:00
dist Rebuild dist 2024-09-23 13:39:20 -04:00
src Convert to use src and dist paths 2023-09-15 10:56:32 -04:00
.eslintignore Move linting and license handling 2023-09-15 10:54:58 -04:00
.gitattributes Enforce line-ending style 2023-11-28 12:45:43 -05:00
.gitignore Remove node_modules 2023-09-15 10:58:20 -04:00
.licensed.yml Update npm scripts 2024-02-22 11:38:39 -05:00
.node-version Formatting and permissions 2023-11-27 23:58:26 -05:00
.prettierignore Move linting and license handling 2023-09-15 10:54:58 -04:00
.prettierrc.json Move linting and license handling 2023-09-15 10:54:58 -04:00
CODEOWNERS Update CODEOWNERS 2023-12-15 10:19:33 -05:00
LICENSE Update LICENSE to standard 2023-11-16 10:28:38 -05:00
README.md Fix rocket emoji in README 2024-08-12 12:16:50 -07:00
action.yml Format action.yml 2023-09-15 10:55:34 -04:00
package-lock.json Bump @vercel/ncc from 0.38.1 to 0.38.2 in the npm-development group 2024-09-23 17:37:04 +00:00
package.json Bump @vercel/ncc from 0.38.1 to 0.38.2 in the npm-development group 2024-09-23 17:37:04 +00:00

Hello, World! JavaScript Action

GitHub Super-Linter CI

This action prints Hello, World! or Hello, <who-to-greet>! to the log. To learn how this action was built, see Creating a JavaScript action.

Create Your Own Action

To create your own action, you can use this repository as a template! Just follow the below instructions:

  1. Click the Use this template button at the top of the repository
  2. Select Create a new repository
  3. Select an owner and name for your new repository
  4. Click Create repository
  5. Clone your new repository

[!CAUTION]

Make sure to remove or update the CODEOWNERS file! For details on how to use this file, see About code owners.

Usage

Here's an example of how to use this action in a workflow file:

name: Example Workflow

on:
  workflow_dispatch:
    inputs:
      who-to-greet:
        description: Who to greet in the log
        required: true
        default: 'World'
        type: string

jobs:
  say-hello:
    name: Say Hello
    runs-on: ubuntu-latest

    steps:
      # Change @main to a specific commit SHA or version tag, e.g.:
      # actions/hello-world-javascript-action@e76147da8e5c81eaf017dede5645551d4b94427b
      # actions/hello-world-javascript-action@v1.2.3
      - name: Print to Log
        id: print-to-log
        uses: actions/hello-world-javascript-action@main
        with:
          who-to-greet: ${{ inputs.who-to-greet }}

For example workflow runs, check out the Actions tab! 🚀

Inputs

Input Default Description
who-to-greet World The name of the person to greet

Outputs

Output Description
time The time we greeted you