Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/actions/hello-world-javascript-action
A template to demonstrate how to build a JavaScript action.
https://github.com/actions/hello-world-javascript-action
Last synced: about 9 hours ago
JSON representation
A template to demonstrate how to build a JavaScript action.
- Host: GitHub
- URL: https://github.com/actions/hello-world-javascript-action
- Owner: actions
- License: mit
- Created: 2019-08-03T21:40:41.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-10-28T15:28:15.000Z (4 months ago)
- Last Synced: 2024-10-29T14:32:39.566Z (4 months ago)
- Language: JavaScript
- Homepage: https://docs.github.com/en/actions/creating-actions/creating-a-javascript-action
- Size: 3.08 MB
- Stars: 243
- Watchers: 26
- Forks: 214
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
- awesome-actions - actions/hello-world-javascript-action - A template to demonstrate how to build a JavaScript action. (Official Resources / Create your Actions)
- fucking-awesome-actions - actions/hello-world-javascript-action - A template to demonstrate how to build a JavaScript action. (Official Resources / Create your Actions)
- awesome-workflows - actions/hello-world-javascript-action - A template to demonstrate how to build a JavaScript action. (Official Resources / Create your Actions)
README
# Hello, World! JavaScript Action
[![GitHub Super-Linter](https://github.com/actions/hello-world-javascript-action/actions/workflows/linter.yml/badge.svg)](https://github.com/super-linter/super-linter)
![CI](https://github.com/actions/hello-world-javascript-action/actions/workflows/ci.yml/badge.svg)This action prints `Hello, World!` or `Hello, !` to the log. To
learn how this action was built, see
[Creating a JavaScript action](https://docs.github.com/en/actions/creating-actions/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
1. Select **Create a new repository**
1. Select an owner and name for your new repository
1. Click **Create repository**
1. Clone your new repository> [!CAUTION]
>
> Make sure to remove or update the [`CODEOWNERS`](./CODEOWNERS) file! For
> details on how to use this file, see
> [About code owners](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners).## Usage
Here's an example of how to use this action in a workflow file:
```yaml
name: Example Workflowon:
workflow_dispatch:
inputs:
who-to-greet:
description: Who to greet in the log
required: true
default: 'World'
type: stringjobs:
say-hello:
name: Say Hello
runs-on: ubuntu-lateststeps:
# Change @main to a specific commit SHA or version tag, e.g.:
# actions/hello-world-javascript-action@e76147da8e5c81eaf017dede5645551d4b94427b
# actions/[email protected]
- 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](https://github.com/actions/hello-world-javascript-action/actions)!
🚀## Inputs
| Input | Default | Description |
| -------------- | ------- | ------------------------------- |
| `who-to-greet` | `World` | The name of the person to greet |## Outputs
| Output | Description |
| ------ | ----------------------- |
| `time` | The time we greeted you |## Dependency License Management
This template includes a GitHub Actions workflow,
[`licensed.yml`](./.github/workflows/licensed.yml), that uses
[Licensed](https://github.com/licensee/licensed) to check for dependencies with
missing or non-compliant licenses. This workflow is initially disabled. To
enable the workflow, follow the below steps.1. Open [`licensed.yml`](./.github/workflows/licensed.yml)
1. Uncomment the following lines:```yaml
# pull_request:
# branches:
# - main
# push:
# branches:
# - main
```1. Save and commit the changes
Once complete, this workflow will run any time a pull request is created or
changes pushed directly to `main`. If the workflow detects any dependencies with
missing or non-compliant licenses, it will fail the workflow and provide details
on the issue(s) found.### Updating Licenses
Whenever you install or update dependencies, you can use the Licensed CLI to
update the licenses database. To install Licensed, see the project's
[Readme](https://github.com/licensee/licensed?tab=readme-ov-file#installation).To update the cached licenses, run the following command:
```bash
licensed cache
```To check the status of cached licenses, run the following command:
```bash
licensed status
```