Skip to content

Commit

Permalink
add job to lint posts on push
Browse files Browse the repository at this point in the history
  • Loading branch information
dogle-scottlogic committed Nov 21, 2024
1 parent 3ee001d commit 478bc4f
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
key: v0-blog-yarn-cache-{{ checksum "yarn.lock" }}
paths:
- ./node_modules
- run: yarn test
- run: yarn lint
workflows:
version: 2
build_and_test:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-a11y-of-changed-content.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Check accessibility of changed content

on:
workflow_dispatch:
pull_request:
pull_request_target:
types: [opened, synchronize, reopened]

permissions:
contents: read
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Lint Posts

on:
push:
branches:
- '**' # Runs on pushes to all branches
pull_request:
branches:
- 'gh-pages' # Runs when a PR targets the gh-pages branch

jobs:
lint-posts:
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
- name: Run install
uses: borales/[email protected]
with:
cmd: install
- name: Run lint
uses: borales/[email protected]
with:
cmd: lint
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"url": "https://github.com/ScottLogic/blog/issues"
},
"scripts": {
"test": "node lintPosts.js",
"lint": "node lintPosts.js",
"compute-embeddings": "node scripts/generate-related/compute-embeddings.js",
"generate-related": "node scripts/generate-related/blog-metadata.js",
"remove-unused-images": "node scripts/images/remove-images.js",
Expand Down

0 comments on commit 478bc4f

Please sign in to comment.