From d17ca00fbac8cdc437174bc896f6ee3be217b6a8 Mon Sep 17 00:00:00 2001 From: Nick Alteen Date: Fri, 15 Sep 2023 11:33:09 -0400 Subject: [PATCH] Update README and CODEOWNERS --- CODEOWNERS | 4 +++ LICENSE | 13 ++++---- README.md | 98 ++++++++++++++++++++++++++++++++++++++++++++++-------- 3 files changed, 96 insertions(+), 19 deletions(-) create mode 100644 CODEOWNERS diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..a9802d7 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,4 @@ +# Repository CODEOWNERS + +* @actions/actions-runtime +* @ncalteen diff --git a/LICENSE b/LICENSE index de88db8..a67dca8 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,7 @@ -MIT License -Copyright (c) 2019 GitHub Actions +The MIT License (MIT) + +Copyright (c) 2018 GitHub, Inc. and contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -9,13 +10,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md index 70f4ce9..ab62e12 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,95 @@ -# Hello world docker action +# Hello, World! Docker Action -This action prints "Hello World" to the log or "Hello" + the name of a person to greet. To learn how this action was built, see "[Creating a Docker container action](https://docs.github.com/en/actions/creating-actions/creating-a-docker-container-action)" in the GitHub Docs. +[![GitHub Super-Linter](https://github.com/actions/hello-world-docker-action/actions/workflows/linter.yml/badge.svg)](https://github.com/super-linter/super-linter) +![CI](https://github.com/actions/hello-world-docker-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 Docker container action](https://docs.github.com/en/actions/creating-actions/creating-a-docker-container-action). + +## Usage + +Here's an example of how to use this action in a workflow file: + +```yaml +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-docker-action@e76147da8e5c81eaf017dede5645551d4b94427b + # actions/hello-world-docker-action@v1.2.3 + - name: Print to Log + id: print-to-log + uses: actions/hello-world-docker-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-docker-action/actions)! +:rocket: ## Inputs -### `who-to-greet` - -**Required** The name of the person to greet. Default `"World"`. +| Input | Default | Description | +| -------------- | ------- | ------------------------------- | +| `who-to-greet` | `World` | The name of the person to greet | ## Outputs -### `time` +| Output | Description | +| ------ | ----------------------- | +| `time` | The time we greeted you | -The time we greeted you. +## Test Locally -## Example usage +After you've cloned the repository to your local machine or codespace, you'll +need to perform some initial setup steps before you can test your action. -```yaml -uses: actions/hello-world-docker-action@main -with: - who-to-greet: 'Mona the Octocat' -``` +> [!NOTE] +> +> You'll need to have a reasonably modern version of +> [Docker](https://www.docker.com/get-started/) handy (e.g. docker engine +> version 20 or later). + +1. :hammer_and_wrench: Build the container + + Make sure to replace `actions/hello-world-docker-action` with an appropriate + label for your container. + + ```bash + docker build -t actions/hello-world-docker-action . + ``` + +1. :white_check_mark: Test the container + + You can pass individual environment variables using the `--env` or `-e` flag. + + ```bash + $ docker run --env INPUT_WHO_TO_GREET="Mona Lisa Octocat" actions/hello-world-docker-action + ::notice file=entrypoint.sh,line=7::Hello, Mona Lisa Octocat! + ``` + + Or you can pass a file with environment variables using `--env-file`. + + ```bash + $ cat ./.env.test + INPUT_WHO_TO_GREET="Mona Lisa Octocat" + + $ docker run --env-file ./.env.test actions/hello-world-docker-action + ::notice file=entrypoint.sh,line=7::Hello, Mona Lisa Octocat! + ```