mirror of
https://github.com/actions/container-action.git
synced 2025-06-15 01:37:42 +00:00
Add output and logging to container
This commit is contained in:
parent
dd2f5f03b8
commit
fd8511c33b
12
Dockerfile
12
Dockerfile
@ -1,7 +1,11 @@
|
|||||||
FROM alpine:3.10
|
# Set the base image to use for subsequent instructions
|
||||||
|
FROM alpine:3.18
|
||||||
|
|
||||||
COPY LICENSE README.md /
|
# Set the working directory inside the container
|
||||||
|
WORKDIR /usr/src
|
||||||
|
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
# Copy any source file(s) required for the action
|
||||||
|
COPY entrypoint.sh .
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
# Configure the container to be run as an executable
|
||||||
|
ENTRYPOINT ["/usr/src/entrypoint.sh"]
|
||||||
|
27
action.yml
27
action.yml
@ -1,12 +1,21 @@
|
|||||||
name: 'Container Action Template'
|
name: 'The name of your action here'
|
||||||
description: 'Get started with Container actions'
|
description: 'Provide a description here'
|
||||||
author: 'GitHub'
|
author: 'Your name or organization here'
|
||||||
|
|
||||||
|
# Define your inputs here.
|
||||||
inputs:
|
inputs:
|
||||||
myInput:
|
who-to-greet:
|
||||||
description: 'Input to use'
|
description: 'Your input description here'
|
||||||
default: 'world'
|
required: true
|
||||||
|
default: 'World'
|
||||||
|
|
||||||
|
# Define your outputs here.
|
||||||
|
outputs:
|
||||||
|
greeting:
|
||||||
|
description: 'Your output description here'
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'docker'
|
using: docker
|
||||||
image: 'Dockerfile'
|
image: Dockerfile
|
||||||
args:
|
args:
|
||||||
- ${{ inputs.myInput }}
|
- ${{ inputs.who-to-greet }}
|
||||||
|
@ -1,3 +1,12 @@
|
|||||||
#!/bin/sh -l
|
#!/bin/sh -l
|
||||||
|
|
||||||
echo "hello $1"
|
# Use INPUT_<INPUT_NAME> to get the value of an input
|
||||||
|
GREETING="Hello, $INPUT_WHO_TO_GREET!"
|
||||||
|
|
||||||
|
# Use workflow commands to do things like set debug messages
|
||||||
|
echo "::notice file=entrypoint.sh,line=7::$GREETING"
|
||||||
|
|
||||||
|
# Write outputs to the $GITHUB_OUTPUT file
|
||||||
|
echo "greeting=$GREETING" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user