Skip to content

Commit

Permalink
💚 (toolchain): Use jq to update the packageManager key
Browse files Browse the repository at this point in the history
  • Loading branch information
valpinkman committed Nov 5, 2024
1 parent ec18236 commit d46bbe5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
14 changes: 2 additions & 12 deletions .github/workflows/update_toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,8 @@ jobs:
- name: Update package.json
if: steps.changes.outputs.status > 0
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const packageJson = fs.readFileSync('./package.json', 'utf8');
const json = JSON.parse(packageJson);
const packageManager = json.packageManager;
const newVersion = `pnpm@${{ steps.new-versions.outputs.version }}`;
if (packageManager !== newVersion) {
json.packageManager = newVersion;
fs.writeFileSync('./package.json', JSON.stringify(json, null, 2));
}
run: |
jq '.packageManager = "pnpm@${{ steps.new-versions.outputs.version }}"' package.json > tmp.json && mv tmp.json package.json
- name: Health check
if: steps.changes.outputs.status > 0
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@
"node": ">=20"
},
"packageManager": "[email protected]"
}
}

0 comments on commit d46bbe5

Please sign in to comment.