Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,26 @@ name: Lint
on:
pull_request:
branches: [main]
paths:
- 'src/pages/**'

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Check for src/pages changes
id: changes
run: |
git diff --name-only origin/${{ github.base_ref }}...HEAD | grep -q '^src/pages/' \
&& echo "changed=true" >> $GITHUB_OUTPUT \
|| echo "changed=false" >> $GITHUB_OUTPUT

- name: Lint
id: lint
if: steps.changes.outputs.changed == 'true'
continue-on-error: true
run: npx --yes github:AdobeDocs/adp-devsite-utils runLint -v

Expand All @@ -30,7 +38,8 @@ jobs:
path: |
linter-report.txt
pr-number.txt
if-no-files-found: ignore

- name: Fail if linter found errors
if: steps.lint.outcome == 'failure'
if: steps.changes.outputs.changed == 'true' && steps.lint.outcome == 'failure'
run: exit 1