From 95c7628628e6a6e04ca06848395c9816dd8934a3 Mon Sep 17 00:00:00 2001 From: david Date: Sat, 27 Jul 2024 13:19:57 +0200 Subject: [PATCH] My first action is ready --- Dockerfile | 8 ++++++++ README.md | 21 +++++++++++++++++++++ action.yml | 16 ++++++++++++++++ entrypoint.sh | 5 +++++ 4 files changed, 50 insertions(+) create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 action.yml create mode 100644 entrypoint.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b77ef9e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +# Container image that runs your code +FROM alpine:3.20 + +# Copies your code file from your action repository to the filesystem path `/` of the container +COPY --chmod=555 entrypoint.sh /entrypoint.sh + +# Code file to execute when the docker container starts up (`entrypoint.sh`) +ENTRYPOINT ["/entrypoint.sh"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..4638115 --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# Hello world docker action + +This action prints "Hello World" or "Hello" + the name of a person to greet to the log. + +## Inputs + +## `who-to-greet` + +**Required** The name of the person to greet. Default `"World"`. + +## Outputs + +## `time` + +The time we greeted you. + +## Example usage + +uses: actions/hello-world-docker-action@v2 +with: + who-to-greet: 'Mona the Octocat' diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..782c830 --- /dev/null +++ b/action.yml @@ -0,0 +1,16 @@ +# action.yml +name: 'Hello World' +description: 'Greet someone and record the time' +inputs: + who-to-greet: # id of input + description: 'Who to greet' + required: true + default: 'World' +outputs: + time: # id of output + description: 'The time we greeted you' +runs: + using: 'docker' + image: 'Dockerfile' + args: + - ${{ inputs.who-to-greet }} diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..3fee027 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/sh -l + +echo "Hello $1" +time=$(date) +echo "time=$time" >> $GITHUB_OUTPUT