Skip to content

Commit 7bcacc2

Browse files
committed
gpr
1 parent 14d52b7 commit 7bcacc2

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

.github/workflows/gpr-name.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const fs = require('fs')
2+
const path = require('path')
3+
4+
function changeName(fileName, name) {
5+
const data = JSON.parse(fs.readFileSync(fileName, 'utf8'))
6+
data.name = name
7+
fs.writeFileSync(fileName, JSON.stringify(data, null, 2))
8+
}
9+
10+
process.argv.slice(3).forEach(fileName => changeName(fileName, process.argv[2]))

.github/workflows/npm-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
with:
4444
node-version: 15
4545
registry-url: https://npm.pkg.github.com/
46-
scope: '@cvzi'
46+
- run: node $GITHUB_WORKSPACE.github/workflows/gpr-name.js @$GITHUB_REPOSITORY package.json package-lock.json
4747
- run: npm ci
4848
- run: npm publish
4949
env:

0 commit comments

Comments
 (0)