Skip to content

Commit

Permalink
Merge pull request #68 from duhrer/GH-67
Browse files Browse the repository at this point in the history
GH-67: Updated CI configuration to use LTS versions of Node.js (resolves #67)
  • Loading branch information
duhrer authored Apr 29, 2024
2 parents 76ff7b3 + 714e20f commit 6565d5e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"es6": true
},
"rules": {
"indent": [
"@stylistic/js/indent": [
"error",
4,
{ "SwitchCase": 1}
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@ jobs:

strategy:
matrix:
node-version: [16.x, 18.x]
node-version: [18.x, 20.x]

env:
HEADLESS: true

steps:
- uses: actions/checkout@v2

- name: Configure default git branch
run: git config --global init.defaultBranch main

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
Expand Down
10 changes: 9 additions & 1 deletion src/js/lint-all.js
Original file line number Diff line number Diff line change
Expand Up @@ -482,9 +482,17 @@ fluid.lintAll.getStagedFiles = function (pathToCheck) {
var changedFiles = [];
var sanitisedRootPath = fluid.glob.sanitisePath(pathToCheck);

// If we are somehow run against something that isn't a git repo, swallow the error and exit.
try {
child_process.execSync("git status", { cwd: pathToCheck, encoding: "utf-8"});
}
catch (error) {
return changedFiles;
}

try {
// https://stackoverflow.com/questions/33610682/git-list-of-staged-files
var output = child_process.execSync("git diff --cached --name-only ", {
var output = child_process.execSync("git diff --cached --name-only", {
cwd: pathToCheck,
encoding: "utf-8"
});
Expand Down

0 comments on commit 6565d5e

Please sign in to comment.