From c7e5ae7513e24c0b5a5cc458ec23eb8972208c8b Mon Sep 17 00:00:00 2001 From: "Stanislav N. aka pztrn" Date: Fri, 19 Jul 2024 15:11:50 +0500 Subject: [PATCH] Try to make it github/gitea actionable. --- Dockerfile | 2 ++ action.yml | 19 +++++++++++++++++++ entrypoint.sh | 4 ++++ 3 files changed, 25 insertions(+) create mode 100644 action.yml create mode 100644 entrypoint.sh diff --git a/Dockerfile b/Dockerfile index de37075..79a70cf 100755 --- a/Dockerfile +++ b/Dockerfile @@ -17,3 +17,5 @@ RUN mkdir /home/container && chmod 0777 /home/container ENV HOME=/home/container ENV GOPATH=/home/container/go ENV GOCACHE=/home/container/.cache + +ENTRYPOINT ["/src/entrypoint.sh"] diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..56f75c7 --- /dev/null +++ b/action.yml @@ -0,0 +1,19 @@ +# action.yml +name: "Go Toolbox" +description: "A toolbox for golang applications development." +author: "Stanislav N. aka pztrn" +inputs: + command: # id of input + description: "Command to run." + required: true + default: "task" + args: + description: "Arguments to pass to command." + required: true + default: "-l" +runs: + using: "docker" + image: "Dockerfile" + args: + - ${{ inputs.command }} + - ${{ inputs.args }} diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..12d8bc4 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +# Entrypoint that handles both GitHub/Gitea actions things and direct commands execution. +"$@"