mirror of
https://github.com/actions/container-action.git
synced 2025-06-14 17:27: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'
|
||||
description: 'Get started with Container actions'
|
||||
author: 'GitHub'
|
||||
name: 'The name of your action here'
|
||||
description: 'Provide a description here'
|
||||
author: 'Your name or organization here'
|
||||
|
||||
# Define your inputs here.
|
||||
inputs:
|
||||
myInput:
|
||||
description: 'Input to use'
|
||||
default: 'world'
|
||||
who-to-greet:
|
||||
description: 'Your input description here'
|
||||
required: true
|
||||
default: 'World'
|
||||
|
||||
# Define your outputs here.
|
||||
outputs:
|
||||
greeting:
|
||||
description: 'Your output description here'
|
||||
|
||||
runs:
|
||||
using: 'docker'
|
||||
image: 'Dockerfile'
|
||||
using: docker
|
||||
image: Dockerfile
|
||||
args:
|
||||
- ${{ inputs.myInput }}
|
||||
- ${{ inputs.who-to-greet }}
|
||||
|
@ -1,3 +1,12 @@
|
||||
#!/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