check-package-lock 1.13.0 → 1.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -79,18 +79,19 @@ jobs:
79
79
  # https://github.com/AODocs/check-eol/releases
80
80
 
81
81
  - name: Lint
82
- run: ./node_modules/.bin/eslint '*.js' 'test/*.js'
82
+ run: npm run eslint
83
83
 
84
84
  - name: Run tests with coverage
85
- run: ./node_modules/.bin/nyc npm test
85
+ run: ./node_modules/.bin/c8 ./node_modules/.bin/mocha
86
86
 
87
87
  - name: Generate coverage report
88
- run: ./node_modules/.bin/nyc report --reporter=text-lcov > coverage.lcov
88
+ run: ./node_modules/.bin/c8 report --reporter=lcov
89
89
 
90
90
  - name: Upload coverage to Codecov
91
91
  uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
92
92
  # https://github.com/codecov/codecov-action/releases
93
93
  with:
94
+ files: coverage/lcov.info
94
95
  fail_ci_if_error: true
95
96
  env:
96
97
  CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
@@ -0,0 +1,115 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ concurrency:
9
+ group: ${{ github.workflow }}-${{ github.ref }}
10
+ cancel-in-progress: false
11
+
12
+ permissions:
13
+ contents: read
14
+
15
+ jobs:
16
+ test:
17
+ name: Test
18
+ runs-on: ubuntu-latest
19
+ environment: Development
20
+ # Skip if this push is the automated version bump commit
21
+ if: "!contains(github.event.head_commit.message, '[skip ci]')"
22
+
23
+ steps:
24
+ - name: Harden Runner
25
+ uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
26
+ # https://github.com/step-security/harden-runner/releases
27
+ with:
28
+ egress-policy: audit
29
+
30
+ - name: Checkout repository
31
+ uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
32
+ # https://github.com/actions/checkout/releases
33
+ with:
34
+ persist-credentials: false
35
+
36
+ - name: Setup Node.js
37
+ uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
38
+ # https://github.com/actions/setup-node/releases
39
+ with:
40
+ node-version: "lts/*"
41
+ cache: npm
42
+
43
+ - name: Install dependencies
44
+ run: npm ci
45
+
46
+ - name: Lint
47
+ run: npm run eslint
48
+
49
+ - name: Run tests
50
+ run: npm test
51
+
52
+ release:
53
+ name: Publish and Release
54
+ needs: test
55
+ runs-on: ubuntu-latest
56
+ environment: Release
57
+ if: "!contains(github.event.head_commit.message, '[skip ci]')"
58
+
59
+ permissions:
60
+ contents: write # push version bump commit, create tags and GitHub releases
61
+ id-token: write # npm provenance attestation
62
+
63
+ steps:
64
+ - name: Harden Runner
65
+ uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
66
+ # https://github.com/step-security/harden-runner/releases
67
+ with:
68
+ egress-policy: audit
69
+
70
+ - name: Checkout repository
71
+ uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
72
+ # https://github.com/actions/checkout/releases
73
+ with:
74
+ # persist-credentials needed to push the version bump commit back
75
+ persist-credentials: true
76
+ token: ${{ secrets.GITHUB_TOKEN }}
77
+
78
+ - name: Setup Node.js
79
+ uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
80
+ # https://github.com/actions/setup-node/releases
81
+ with:
82
+ node-version: "lts/*"
83
+ cache: npm
84
+ registry-url: "https://registry.npmjs.org"
85
+
86
+ - name: Install dependencies
87
+ run: npm ci
88
+
89
+ - name: Configure git
90
+ run: |
91
+ git config user.name "github-actions[bot]"
92
+ git config user.email "github-actions[bot]@users.noreply.github.com"
93
+
94
+ - name: Bump patch version
95
+ id: bump
96
+ run: |
97
+ npm version patch -m "chore: release %s [skip ci]"
98
+ VERSION=$(node -p "require('./package.json').version")
99
+ echo "version=v${VERSION}" >> $GITHUB_OUTPUT
100
+
101
+ - name: Push version bump
102
+ run: git push --follow-tags
103
+
104
+ - name: Publish to npm
105
+ run: npm publish --provenance --access public
106
+
107
+ - name: Create GitHub release
108
+ # zizmor: ignore[template-injection] VERSION is passed as env var, not interpolated into shell
109
+ run: |
110
+ gh release create "$VERSION" \
111
+ --title "$VERSION" \
112
+ --generate-notes
113
+ env:
114
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
115
+ VERSION: ${{ steps.bump.outputs.version }}
package/.typo-ci.yml CHANGED
@@ -1,6 +1,6 @@
1
- dictionaries:
2
- - en
3
-
4
- excluded_words:
5
- - endofline
6
- - sep
1
+ dictionaries:
2
+ - en
3
+
4
+ excluded_words:
5
+ - endofline
6
+ - sep
package/eslint.config.js CHANGED
@@ -1,17 +1,15 @@
1
- import globals from "globals";
2
- import js from "@eslint/js";
3
-
4
-
5
- export default [
6
- {
7
- languageOptions: {
8
- globals: {
9
- process: "readonly",
10
- describe: "readonly",
11
- it: "readonly",
12
- ...globals.browser
13
- }
14
- }
15
- },
16
- js.configs.recommended,
17
- ];
1
+ import globals from "globals";
2
+ import js from "@eslint/js";
3
+
4
+ export default [
5
+ {
6
+ languageOptions: {
7
+ globals: {
8
+ ...globals.node,
9
+ describe: "readonly",
10
+ it: "readonly",
11
+ }
12
+ }
13
+ },
14
+ js.configs.recommended,
15
+ ];
package/index.js CHANGED
@@ -3,9 +3,6 @@
3
3
  import fs from 'node:fs';
4
4
  import path from 'node:path';
5
5
  import { program } from 'commander';
6
- import { fileURLToPath } from 'node:url';
7
-
8
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
9
6
 
10
7
  function checkFolder(folder) {
11
8
  const packPath = folder ? path.join(folder, 'package-lock.json') : 'package-lock.json';
@@ -28,7 +25,7 @@ function checkFolder(folder) {
28
25
  }
29
26
 
30
27
  program
31
- .version(JSON.parse(fs.readFileSync(path.join(__dirname, 'package.json'))).version)
28
+ .version(JSON.parse(fs.readFileSync(path.join(import.meta.dirname, 'package.json'))).version)
32
29
  .description('Checks the package-lock.json file for http:// links')
33
30
  .option('-f, --folder <folder>', 'Folder with package-lock.json file')
34
31
  .parse(process.argv);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "check-package-lock",
3
- "version": "1.13.0",
3
+ "version": "1.14.1",
4
4
  "description": "Checks the package-lock.json file for insecure http:// links",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -36,12 +36,10 @@
36
36
  },
37
37
  "devDependencies": {
38
38
  "@eslint/js": "^10.0.1",
39
+ "c8": "^11.0.0",
39
40
  "chai": "^6.2.2",
40
- "child_process": "^1.0.2",
41
41
  "eslint": "^10.5.0",
42
- "expect": "^30.4.1",
43
42
  "globals": "^17.6.0",
44
- "mocha": "^11.7.6",
45
- "nyc": "^18.0.0"
43
+ "mocha": "^11.7.6"
46
44
  }
47
45
  }
@@ -1,3 +1,3 @@
1
- {
2
- "resolved": "http://registry.npmjs.org/blablabla"
3
- }
1
+ {
2
+ "resolved": "http://registry.npmjs.org/blablabla"
3
+ }
@@ -1,3 +1,3 @@
1
- {
2
- "resolved": "https://registry.npmjs.org/blablabla"
3
- }
1
+ {
2
+ "resolved": "https://registry.npmjs.org/blablabla"
3
+ }
@@ -1,4 +1,4 @@
1
- {
2
- "resolved": "https://registry.npmjs.org/blablabla",
3
- "resolve": "http://registry.npmjs.org"
4
- }
1
+ {
2
+ "resolved": "https://registry.npmjs.org/blablabla",
3
+ "resolve": "http://registry.npmjs.org"
4
+ }
@@ -1,9 +0,0 @@
1
- {
2
- "permissions": {
3
- "allow": [
4
- "Bash(npm show *)",
5
- "Bash(./node_modules/.bin/eslint '*.js' 'test/*.js')",
6
- "Bash(npm test *)"
7
- ]
8
- }
9
- }