Repository navigation
Expand file tree
/
Copy pathaction.yaml
More file actions
44 lines (43 loc) · 1.63 KB
/
Copy pathaction.yaml
File metadata and controls
44 lines (43 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Validate manifest naming
description: Validate configurable Kubernetes manifest and machine patch naming conventions.
author: devantler-tech
inputs:
config-file:
description: Configuration file, relative to working-directory or absolute.
required: false
default: .github/manifest-naming.yaml
working-directory:
description: Repository directory to validate, relative to GITHUB_WORKSPACE or absolute.
required: false
default: .
outputs:
validated:
description: The string true after successful validation; empty when unsuccessful.
value: ${{ steps.validate.outputs.validated }}
runs:
using: composite
steps:
- name: Set up Go for the validator
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version-file: ${{ github.action_path }}/go.mod
cache: false
- name: Validate naming conventions
id: validate
shell: bash
env:
ACTION_PATH: ${{ github.action_path }}
CONFIG_FILE: ${{ inputs.config-file }}
WORKING_DIRECTORY: ${{ inputs.working-directory }}
GOWORK: "off"
GOFLAGS: ""
GOTOOLCHAIN: local
run: |
set -euo pipefail
cd "$GITHUB_WORKSPACE"
temporary=$(mktemp -d "$RUNNER_TEMP/validate-naming.XXXXXX")
trap 'rm -rf "$temporary"' EXIT
bash "$ACTION_PATH/../../.scripts/retry.sh" go -C "$ACTION_PATH" mod download
go -C "$ACTION_PATH" build -mod=readonly -trimpath -o "$temporary/validate-naming" .
"$temporary/validate-naming" --root "$WORKING_DIRECTORY" --config "$CONFIG_FILE"
echo "validated=true" >> "$GITHUB_OUTPUT"