Merge pull request #17 from itzMiney/itzMiney-patch-1

Update CI workflow to limit PR paths
This commit is contained in:
Michael authored and GitHub committed 2026-01-28 21:59:46 +01:00
commit 2f81433d71
1 file changed
+36 -3
+36 -3
View File
@@ -2,7 +2,6 @@ name: CI
on:
pull_request:
push:
branches: [ master ]
jobs:
@@ -11,18 +10,52 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Detect relevant changes
id: changes
shell: bash
run: |
BASE="${{ github.event.pull_request.base.sha }}"
HEAD="${{ github.sha }}"
echo "Base: $BASE"
echo "Head: $HEAD"
files="$(git diff --name-only "$BASE" "$HEAD")"
echo "Changed files:"
echo "$files"
if echo "$files" | grep -Eq '^(src/|scripts/|angular\.json$|tsconfig.*\.json$|package\.json$|package-lock\.json$|public/i18n/)'; then
echo "run_build=true" >> "$GITHUB_OUTPUT"
else
echo "run_build=false" >> "$GITHUB_OUTPUT"
fi
- name: Skip build (no relevant changes)
if: steps.changes.outputs.run_build != 'true'
run: |
echo "No files changed that affect the build/tests. Marking CI as successful."
exit 0
- name: Setup Node
if: steps.changes.outputs.run_build == 'true'
uses: actions/setup-node@v4
with:
node-version: 24.13.0
cache: npm
- run: npm i -g npm@11.8.0
- run: npm --version
- name: Pin npm version
if: steps.changes.outputs.run_build == 'true'
run: |
npm i -g npm@11.8.0
npm --version
- name: Install dependencies
if: steps.changes.outputs.run_build == 'true'
run: npm ci
- name: Build
if: steps.changes.outputs.run_build == 'true'
run: npm run build --if-present