chore(go): compose vociferate runtime flow
This commit is contained in:
104
run-vociferate.code/action.yml
Normal file
104
run-vociferate.code/action.yml
Normal file
@@ -0,0 +1,104 @@
|
||||
name: vociferate/run-vociferate-code
|
||||
description: Execute vociferate from the checked-out Go source.
|
||||
|
||||
inputs:
|
||||
source-root:
|
||||
description: Action repository root containing the Go module.
|
||||
required: true
|
||||
root:
|
||||
description: Repository root to pass to vociferate.
|
||||
required: true
|
||||
version-file:
|
||||
description: Optional version file path.
|
||||
required: false
|
||||
default: ''
|
||||
version-pattern:
|
||||
description: Optional version pattern.
|
||||
required: false
|
||||
default: ''
|
||||
changelog:
|
||||
description: Optional changelog path.
|
||||
required: false
|
||||
default: ''
|
||||
version:
|
||||
description: Optional version argument.
|
||||
required: false
|
||||
default: ''
|
||||
date:
|
||||
description: Optional date argument.
|
||||
required: false
|
||||
default: ''
|
||||
recommend:
|
||||
description: Whether to run vociferate with --recommend.
|
||||
required: false
|
||||
default: 'false'
|
||||
print-unreleased:
|
||||
description: Whether to print the Unreleased body.
|
||||
required: false
|
||||
default: 'false'
|
||||
print-release-notes:
|
||||
description: Whether to print the release notes section for version.
|
||||
required: false
|
||||
default: 'false'
|
||||
|
||||
outputs:
|
||||
stdout:
|
||||
description: Captured stdout from the vociferate invocation.
|
||||
value: ${{ steps.run.outputs.stdout }}
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Run source
|
||||
id: run
|
||||
shell: bash
|
||||
working-directory: ${{ inputs.source-root }}
|
||||
env:
|
||||
ROOT: ${{ inputs.root }}
|
||||
VERSION_FILE: ${{ inputs.version-file }}
|
||||
VERSION_PATTERN: ${{ inputs.version-pattern }}
|
||||
CHANGELOG: ${{ inputs.changelog }}
|
||||
VERSION: ${{ inputs.version }}
|
||||
DATE: ${{ inputs.date }}
|
||||
RECOMMEND: ${{ inputs.recommend }}
|
||||
PRINT_UNRELEASED: ${{ inputs.print-unreleased }}
|
||||
PRINT_RELEASE_NOTES: ${{ inputs.print-release-notes }}
|
||||
VOCIFERATE_REPOSITORY_URL: ${{ vars.VOCIFERATE_REPOSITORY_URL }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
command=(go run ./cmd/vociferate --root "$ROOT")
|
||||
|
||||
if [[ -n "$VERSION_FILE" ]]; then
|
||||
command+=(--version-file "$VERSION_FILE")
|
||||
fi
|
||||
if [[ -n "$VERSION_PATTERN" ]]; then
|
||||
command+=(--version-pattern "$VERSION_PATTERN")
|
||||
fi
|
||||
if [[ -n "$CHANGELOG" ]]; then
|
||||
command+=(--changelog "$CHANGELOG")
|
||||
fi
|
||||
if [[ -n "$VERSION" ]]; then
|
||||
command+=(--version "$VERSION")
|
||||
fi
|
||||
if [[ -n "$DATE" ]]; then
|
||||
command+=(--date "$DATE")
|
||||
fi
|
||||
if [[ "$RECOMMEND" == 'true' ]]; then
|
||||
command+=(--recommend)
|
||||
fi
|
||||
if [[ "$PRINT_UNRELEASED" == 'true' ]]; then
|
||||
command+=(--print-unreleased)
|
||||
fi
|
||||
if [[ "$PRINT_RELEASE_NOTES" == 'true' ]]; then
|
||||
command+=(--print-release-notes)
|
||||
fi
|
||||
|
||||
stdout_file="$(mktemp)"
|
||||
trap 'rm -f "$stdout_file"' EXIT
|
||||
"${command[@]}" > "$stdout_file"
|
||||
|
||||
delimiter="EOF_STDOUT"
|
||||
printf 'stdout<<%s\n' "$delimiter" >> "$GITHUB_OUTPUT"
|
||||
cat "$stdout_file" >> "$GITHUB_OUTPUT"
|
||||
printf '%s\n' "$delimiter" >> "$GITHUB_OUTPUT"
|
||||
Reference in New Issue
Block a user