refactor(actions): simplify run-vociferate runtime flow
This commit is contained in:
@@ -2,9 +2,6 @@ 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
|
||||
@@ -49,10 +46,30 @@ outputs:
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Resolve source root
|
||||
id: resolve-source
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
source_root="$GITHUB_ACTION_PATH"
|
||||
if [[ ! -f "$source_root/go.mod" ]]; then
|
||||
source_root="$(realpath "$GITHUB_ACTION_PATH/..")"
|
||||
fi
|
||||
|
||||
printf 'source_root=%s\n' "$source_root" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.26.1'
|
||||
cache: true
|
||||
cache-dependency-path: ${{ steps.resolve-source.outputs.source_root }}/go.sum
|
||||
|
||||
- name: Run source
|
||||
id: run
|
||||
shell: bash
|
||||
working-directory: ${{ inputs.source-root }}
|
||||
working-directory: ${{ steps.resolve-source.outputs.source_root }}
|
||||
env:
|
||||
ROOT: ${{ inputs.root }}
|
||||
VERSION_FILE: ${{ inputs.version-file }}
|
||||
|
||||
Reference in New Issue
Block a user