diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 44d6c6b7e..bec32fecf 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,8 +3,6 @@ name: Lint on: pull_request: branches: [main] - paths: - - 'src/pages/**' jobs: lint: @@ -12,15 +10,29 @@ jobs: steps: - name: Checkout uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Check for src/pages changes + id: changes + env: + BASE_REF: ${{ github.base_ref }} + run: | + git diff --name-only "origin/${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 - name: Save PR number if: always() - run: echo "${{ github.event.pull_request.number }}" > pr-number.txt + env: + PR_NUMBER: ${{ github.event.pull_request.number }} + run: echo "$PR_NUMBER" > pr-number.txt - name: Upload linter report if: always() @@ -30,7 +42,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 diff --git a/.gitignore b/.gitignore index 530392d55..ee617094f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,21 +1,26 @@ -# OS and IDE generated files # -############################## + +# OS .DS_Store + +# IDE .vscode -.history -.idea -.editorconfig -.cursor/ -.claude/ -# npm yarn +# environment variables +.env + +# npm node_modules package-lock.json + +# generated by .github/workflows/lint.yml +linter-report.txt + +# Preserved from external contributors +.idea +.editorconfig yarn-error.log .pnp.* .yarn/* - -# keep in repo !.gitignore !.yarn.lock !.yarnrc.yml @@ -24,38 +29,12 @@ yarn-error.log !.yarn/releases !.yarn/sdks !.yarn/versions - -# gatsby files -.env .cache public - -# cypress cypress/videos cypress/screenshots - -# lerna lerna-debug.log - -# local actions .actrc .secrets local-test.yml - -# yalc -.yalc yalc.lock - -# Linter outputs -super-linter-output -super-linter.log -linter-report.txt - -# GitHub Actions leftovers -github_conf - -# Temporary files -tmp/ - -# Added by update-bot -linter-output.txt diff --git a/.nvmrc b/.nvmrc index deed13c01..b03f40867 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -lts/jod +lts/krypton diff --git a/package.json b/package.json index fba71bcee..ac25102f9 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,9 @@ "lint": { "skipRules": { "check-frontmatter": { - "paths": ["src/pages/includes"] + "paths": [ + "src/pages/includes" + ] } }, "skipUrlPatterns": [