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
63 changes: 52 additions & 11 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,65 @@
name: linter
name: Node.js Linting

on:
# Execute on every push to any branch
push:
branches:
- "**"
# Execute on every pull request to the master branch
branches: ["**"]
pull_request_target:
branches:
- main
branches: [main]

jobs:
linter:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up node
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- run: npm install -g prettier@latest
- run: prettier --check .
cache: 'npm'

- name: Install dependencies
run: |
if [ -f package.json ]; then
npm install
else
echo "No package.json found, installing global tools only"
fi

# JavaScript/Node.js Linting
- name: Install linting tools
run: npm install -g prettier eslint dockerfilelint

- name: Format check with Prettier (using centralized config)
run: |
# Use centralized prettier config if available
if [ -f "../Pyrrha-Development-Tools/configs/.prettierrc.js" ]; then
npx prettier --config ../Pyrrha-Development-Tools/configs/.prettierrc.js --check "**/*.{js,json,md}"
else
npx prettier --check "**/*.{js,json,md}"
fi

- name: Lint with ESLint (if configured)
run: |
if [ -f .eslintrc.* ] || [ -f eslint.config.* ]; then
npx eslint . || echo "ESLint issues found (non-blocking)"
else
echo "No ESLint configuration found, skipping"
fi

- name: Run tests (if available)
run: |
if [ -f package.json ] && npm run test --if-present; then
npm test
else
echo "No tests configured, skipping"
fi

# Dockerfile Linting
- name: Dockerfile linting
run: |
if ls Dockerfile* 1> /dev/null 2>&1; then
dockerfilelint Dockerfile*
else
echo "No Dockerfiles found, skipping"
fi
2 changes: 1 addition & 1 deletion src/content/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@
"footerLink": "Call for Code® with The Linux Foundation project",
"footer2": ".",
"footerLink2": "",
"copyright": "Copyright © 2021-2022 Pyrrha a Series of LF Projects, LLC.",
"copyright": "Copyright © 2021-2025 Pyrrha a Series of LF Projects, LLC.",
"copyrightInfo": "For trademark usage guidelines, privacy and cookie policies, and other applicable policies, as well as terms and conditions governing this web site, please see www.lfprojects.org."
}
Loading