Code Monkey home page Code Monkey logo

action_test's Introduction

Hello, World! Docker 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 Docker container 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-docker-action@e76147da8e5c81eaf017dede5645551d4b94427b
      # actions/[email protected]
      - 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! :rocket:

Inputs

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

Outputs

Output Description
time The time we greeted you

Test Locally

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.

Note

You'll need to have a reasonably modern version of Docker handy (e.g. docker engine version 20 or later).

  1. ๐Ÿ› ๏ธ Build the container

    Make sure to replace actions/hello-world-docker-action with an appropriate label for your container.

    docker build -t actions/hello-world-docker-action .
  2. โœ… Test the container

    You can pass individual environment variables using the --env or -e flag.

    $ 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.

    $ echo "INPUT_WHO_TO_GREET=\"Mona Lisa Octocat\"" > ./.env.test
    
    $ docker run --env-file ./.env.test actions/hello-world-docker-action
    ::notice file=entrypoint.sh,line=7::Hello, Mona Lisa Octocat!

action_test's People

Contributors

momo-yh avatar

Watchers

 avatar

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.