From 120d4f2a9e82c28bb919d4debdf8b37f7c5decc1 Mon Sep 17 00:00:00 2001 From: lubiana Date: Sun, 15 Dec 2024 12:16:07 +0100 Subject: [PATCH] test --- .forgejo/workflows/demo.yml | 10 ++++++---- actions/hello/Dockerfile | 9 +++++++++ actions/hello/action.yml | 17 +++++++++++++++++ actions/hello/entrypoint.sh | 7 +++++++ 4 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 actions/hello/Dockerfile create mode 100644 actions/hello/action.yml create mode 100755 actions/hello/entrypoint.sh diff --git a/.forgejo/workflows/demo.yml b/.forgejo/workflows/demo.yml index da3569f..b09a87c 100644 --- a/.forgejo/workflows/demo.yml +++ b/.forgejo/workflows/demo.yml @@ -5,8 +5,10 @@ jobs: name: debug steps: - uses: actions/checkout@v4 - - name: build - run: | - apt-get install -y hugo - hugo + - name: hello world action step + uses: ./actions/hello + with: + who-to-greet: 'lubi' + - name: Get the output time + run: echo "The time was ${{ steps.hello.outputs.time }}" diff --git a/actions/hello/Dockerfile b/actions/hello/Dockerfile new file mode 100644 index 0000000..9a59127 --- /dev/null +++ b/actions/hello/Dockerfile @@ -0,0 +1,9 @@ +# Container image that runs your code +FROM alpine:edge + +# Copies your code file from your action repository to the filesystem path `/` of the container +COPY entrypoint.sh /entrypoint.sh + +# Code file to execute when the docker container starts up (`entrypoint.sh`) +ENTRYPOINT ["/entrypoint.sh"] + diff --git a/actions/hello/action.yml b/actions/hello/action.yml new file mode 100644 index 0000000..da7c35e --- /dev/null +++ b/actions/hello/action.yml @@ -0,0 +1,17 @@ +# 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/actions/hello/entrypoint.sh b/actions/hello/entrypoint.sh new file mode 100755 index 0000000..52264ae --- /dev/null +++ b/actions/hello/entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/sh -l + +echo "Hello $1" +time=$(date) +echo "time=$time" >> $GITHUB_OUTPUT + +exit 0