Skip to content

Commit 96537c3

Browse files
committed
chore: sync with template
1 parent 71765d0 commit 96537c3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.github/workflows/release.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v2
14+
- name: Prevent releasing if the repo is generated from the template and pkg.name not changed
15+
run: |
16+
repo="$GITHUB_REPOSITORY"
17+
pkg=$(node -p 'require("./package.json").name')
18+
if [ "$pkg" == "@tlib/package-template" && "$repo" != 'tlibjs/package-template' ]; then
19+
echo 'Please modify "name" field in package.json' >&2
20+
exit 1
21+
else
22+
echo "Start releasing package $pkg in repo $repo"
23+
fi
1424
- name: Use Node.js
1525
uses: actions/setup-node@v1
1626
with:

0 commit comments

Comments
 (0)