action
This commit is contained in:
40
.github/actions/example-composite/action.yml
vendored
Normal file
40
.github/actions/example-composite/action.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
name: Example Composite
|
||||
description: Example composite action for testing.
|
||||
|
||||
inputs:
|
||||
message:
|
||||
description: Message to echo.
|
||||
required: false
|
||||
default: "Hello from composite action"
|
||||
repeat:
|
||||
description: Number of times to print the message.
|
||||
required: false
|
||||
default: "1"
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Show inputs
|
||||
shell: bash
|
||||
run: |
|
||||
echo "message=${{ inputs.message }}"
|
||||
echo "repeat=${{ inputs.repeat }}"
|
||||
|
||||
- name: Print message
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
count="${{ inputs.repeat }}"
|
||||
if ! [[ "$count" =~ ^[0-9]+$ ]]; then
|
||||
echo "repeat must be an integer, got: $count" >&2
|
||||
exit 1
|
||||
fi
|
||||
for _ in $(seq 1 "$count"); do
|
||||
echo "${{ inputs.message }}"
|
||||
done
|
||||
|
||||
- name: Show context
|
||||
shell: bash
|
||||
run: |
|
||||
echo "repo=${GITHUB_REPOSITORY}"
|
||||
echo "ref=${GITHUB_REF}"
|
||||
Reference in New Issue
Block a user