fix/check ci: #2 #5
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |