Skip to content

Commit b396e93

Browse files
authored
Update package-update.yml
1 parent 4e24bb6 commit b396e93

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

.github/workflows/package-update.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,15 @@ jobs:
2828
env:
2929
PKG: ${{ inputs.package }}
3030
- name: Update package.json
31-
run: >
32-
set -euo pipefail
33-
updated="(jq --indent 2 \
34-
--arg pkg "$PKG" --arg version "$VERSION" \
35-
'.dependencies[$pkg] = $version' \
36-
package.json)"
37-
printf '%s' "${updated}" > package.json
31+
run: node -e "$SCRIPT"
3832
env:
3933
PKG: ${{ inputs.package }}
4034
VERSION: ${{ steps.view.version }}
35+
SCRIPT: >
36+
const {PKG, VERSION} = process.env
37+
const pkg = JSON.parse(fs.readFileSync("package.json"))
38+
pkg.dependencies[PKG] = VERSION
39+
fs.writeFileSync("package.json", JSON.stringify(pkg, null, 2))
4140
- name: Update package-lock.json
4241
run: npm update "$PKG" --lock-file-only
4342
env:

0 commit comments

Comments
 (0)