initial commit

This commit is contained in:
2023-03-22 02:09:29 -07:00
commit 25694362f0
16 changed files with 406 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
# Container image that runs your code
FROM busybox:1.36.0
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

View File

@@ -0,0 +1,14 @@
name: busybox
description: "Run busybox commands."
inputs:
args:
description: "Shell arguments to pass into busybox."
required: true
outputs:
console:
description: "The console output of the command."
runs:
using: docker
image: Dockerfile
args:
- ${{ inputs.args }}

View File

@@ -0,0 +1,15 @@
#!/bin/sh
ARGS="$@"
OUTPUT=$(sh -c "$ARGS")
RESULT=$?
echo "$OUTPUT"
#Output multiline strings.
#https://trstringer.com/github-actions-multiline-strings/
OUTPUT="${OUTPUT//'%'/'%25'}"
OUTPUT="${OUTPUT//$'\n'/'%0A'}"
OUTPUT="${OUTPUT//$'\r'/'%0D'}"
echo "::set-output name=console::$OUTPUT"
exit $RESULT