Skip to content

Commit 9b31e61

Browse files
authored
feat: allowing relocking for NPM updates (#20)
* feat: allowing relocking for NPM updates * chore: cspell for 'relock'
1 parent 34b3b98 commit 9b31e61

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

.cspell.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"language": "en",
3-
"words": ["alchemaxinc"],
3+
"words": ["alchemaxinc", "relock"],
44
"files": ["*.md", "*/**/*.md"],
55
"ignoreWords": [],
66
"ignorePaths": [],

npm/README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,21 @@ jobs:
2424
branch-prefix: 'update-npm-deps'
2525
pr-title: 'Update NPM Dependencies'
2626
commit-message: 'Update NPM dependencies'
27-
excluded-packages: 'package1,package2' # Optional
27+
excluded-packages: 'package1,package2'
28+
relock: false
2829
```
2930
3031
## :gear: Inputs
3132
32-
| Input | Description | Required | Default |
33-
| ------------------- | ------------------------------------------- | ------------------ | ------------------------- |
34-
| `base-branch` | Base branch for the pull request | :white_check_mark: | `main` |
35-
| `token` | GitHub token for authentication | :x: | `${{ github.token }}` |
36-
| `branch-prefix` | Prefix for the update branch | :x: | `update-dependencies` |
37-
| `pr-title` | Title for the pull request | :x: | `Update NPM Dependencies` |
38-
| `commit-message` | Commit message for the update | :x: | `Update NPM dependencies` |
39-
| `excluded-packages` | Comma-separated list of packages to exclude | :x: | - |
33+
| Input | Description | Required | Default |
34+
| ------------------- | ------------------------------------------------ | ------------------ | ------------------------- |
35+
| `base-branch` | Base branch for the pull request | :white_check_mark: | `main` |
36+
| `token` | GitHub token for authentication | :x: | `${{ github.token }}` |
37+
| `branch-prefix` | Prefix for the update branch | :x: | `update-dependencies` |
38+
| `pr-title` | Title for the pull request | :x: | `Update NPM Dependencies` |
39+
| `commit-message` | Commit message for the update | :x: | `Update NPM dependencies` |
40+
| `excluded-packages` | Comma-separated list of packages to exclude | :x: | - |
41+
| `relock` | Wether `package-lock.json` should be regenerated | :x: | `false` |
4042

4143
## :warning: Prerequisites
4244

npm/action.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ inputs:
3232
required: false
3333
description: 'Packages to exclude from updates, in a comma-separated list format'
3434

35+
relock:
36+
required: false
37+
description: 'Whether package-lock.json should be regenerated, even if no other updates are available'
38+
default: 'false'
39+
3540
runs:
3641
using: 'composite'
3742
steps:
@@ -72,6 +77,9 @@ runs:
7277
else
7378
ncu -u
7479
fi
80+
if [ "${{ inputs.relock }}" = "true" ]; then
81+
rm -f package-lock.json
82+
fi
7583
npm install
7684
7785
- name: Check for changes

0 commit comments

Comments
 (0)