test
This commit is contained in:
18
itchio/butler/Dockerfile
Normal file
18
itchio/butler/Dockerfile
Normal file
@@ -0,0 +1,18 @@
|
||||
# Container image that runs your code
|
||||
FROM debian:stable-slim
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y \
|
||||
unzip \
|
||||
curl
|
||||
|
||||
RUN curl -L -o butler.zip https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default
|
||||
|
||||
RUN unzip butler.zip && \
|
||||
mv butler /usr/local/bin/butler && \
|
||||
rm butler.zip
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
25
itchio/butler/action.yaml
Normal file
25
itchio/butler/action.yaml
Normal file
@@ -0,0 +1,25 @@
|
||||
name: butler
|
||||
description: "Run butler client commands."
|
||||
inputs:
|
||||
command:
|
||||
description: "Arguments to pass into butler."
|
||||
required: true
|
||||
apiKey:
|
||||
description: "Itch.io API key."
|
||||
required: true
|
||||
catchErrors:
|
||||
description: "Whether or not errors should be handled."
|
||||
required: false
|
||||
outputs:
|
||||
console:
|
||||
description: "The console output of the butler command."
|
||||
exitCode:
|
||||
description: "How the program exited."
|
||||
runs:
|
||||
using: docker
|
||||
image: Dockerfile
|
||||
env:
|
||||
CATCH_ERRORS: ${{ inputs.catchErrors }}
|
||||
BUTLER_API_KEY: ${{ inputs.apiKey }}
|
||||
args:
|
||||
- ${{ inputs.command }}
|
||||
20
itchio/butler/entrypoint.sh
Normal file
20
itchio/butler/entrypoint.sh
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
ARGS="$@"
|
||||
|
||||
exec 5>&1
|
||||
OUTPUT=$(bash -c "butler $ARGS" | tee /dev/fd/5)
|
||||
RESULT=$?
|
||||
|
||||
#Output multiline strings.
|
||||
#https://trstringer.com/github-actions-multiline-strings/
|
||||
if [[ -n "$OUTPUT" ]]; then
|
||||
echo "console<<EOF" >> "$GITHUB_OUTPUT"
|
||||
echo "$OUTPUT" >> "$GITHUB_OUTPUT"
|
||||
echo "EOF" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
echo "exitCode=$RESULT" >> "$GITHUB_OUTPUT"
|
||||
|
||||
if [[ "$CATCH_ERRORS" != "true" ]]; then
|
||||
exit $RESULT
|
||||
fi
|
||||
Reference in New Issue
Block a user