Skip to content
Merged
Show file tree
Hide file tree
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
21 changes: 17 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,36 @@ 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
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()
Expand All @@ -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
51 changes: 15 additions & 36 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/jod
lts/krypton
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
"lint": {
"skipRules": {
"check-frontmatter": {
"paths": ["src/pages/includes"]
"paths": [
"src/pages/includes"
]
}
},
"skipUrlPatterns": [
Expand Down
Loading