-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathaction.yml
More file actions
77 lines (71 loc) · 2 KB
/
action.yml
File metadata and controls
77 lines (71 loc) · 2 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: 'nboot drift check'
description: 'Detect configuration drift from navi-bootstrap template packs'
author: 'Project Navi'
branding:
icon: 'shield'
color: 'blue'
inputs:
spec:
description: 'Path to the nboot spec file'
required: false
default: 'nboot-spec.json'
pack:
description: 'Pack name (built-in) or path to a pack directory'
required: false
default: 'base'
target:
description: 'Project directory to check for drift'
required: false
default: '.'
skip-resolve:
description: 'Skip GitHub SHA resolution (offline mode)'
required: false
default: 'true'
python-version:
description: 'Python version to use'
required: false
default: '3.12'
runs:
using: 'composite'
steps:
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ inputs.python-version }}
- name: Install nboot
shell: bash
env:
ACTION_PATH: ${{ github.action_path }}
run: pip install "$ACTION_PATH"
- name: Resolve pack path
id: pack
shell: bash
env:
PACK: ${{ inputs.pack }}
ACTION_PATH: ${{ github.action_path }}
run: |
if [ -d "$PACK" ]; then
echo "path=$PACK" >> "$GITHUB_OUTPUT"
elif [ -d "$ACTION_PATH/packs/$PACK" ]; then
echo "path=$ACTION_PATH/packs/$PACK" >> "$GITHUB_OUTPUT"
else
echo "::error::Pack not found: $PACK (looked in ./$PACK and $ACTION_PATH/packs/$PACK)"
exit 1
fi
- name: Run drift check
shell: bash
env:
SPEC: ${{ inputs.spec }}
PACK_PATH: ${{ steps.pack.outputs.path }}
TARGET: ${{ inputs.target }}
SKIP_RESOLVE: ${{ inputs.skip-resolve }}
run: |
ARGS=(
--spec "$SPEC"
--pack "$PACK_PATH"
--target "$TARGET"
)
if [ "$SKIP_RESOLVE" = "true" ]; then
ARGS+=(--skip-resolve)
fi
nboot diff "${ARGS[@]}"