-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (34 loc) · 982 Bytes
/
lint.yml
File metadata and controls
42 lines (34 loc) · 982 Bytes
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
name: Zarf Packages - Lint
on:
pull_request:
branches:
- develop
paths:
- '**/zarf.yaml'
jobs:
lint:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Zarf
uses: zarf-dev/setup-zarf@main
with:
version: v0.73.0
- name: Lint Changed Packages
run: |
# Get changed directories
# Use github.base_ref to ensure we compare against the PR's target branch
CHANGED_DIRS=$(git diff --name-only origin/${{ github.base_ref }}...HEAD | grep 'zarf.yaml' | xargs -I {} dirname {} | sort -u)
if [ -z "$CHANGED_DIRS" ]; then
echo "No changes detected in Zarf packages."
exit 0
fi
for DIR in $CHANGED_DIRS; do
echo "📦 Linting: $DIR"
zarf dev lint "$DIR"
done