Skip to content
This repository was archived by the owner on Jul 28, 2022. It is now read-only.

Commit aac5b38

Browse files
Anshul Guleriaanshulguleria
authored andcommitted
[CHORE] Fixes issue with gpr publish
Removed scope as that will be automatically read based on org. Disabled the gpr publish as this doesn't work for non-scoped packages. Added public access to npm publish command for npm registry [TESTING] Tested this by running builds on github actions closes: N/A
1 parent efb0ea4 commit aac5b38

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

.github/workflows/npmpublish.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
name: Node.js Package
55

66
on:
7-
push:
8-
branches:
9-
- master
7+
release:
8+
types: [created]
109

1110
jobs:
1211
build:
@@ -29,11 +28,20 @@ jobs:
2928
node-version: 12
3029
registry-url: https://registry.npmjs.org/
3130
- run: npm ci
32-
- run: npm publish
31+
# This will tell npm to publish your scoped package with public access.
32+
- run: npm publish --access public
3333
env:
3434
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
3535

36+
37+
# Disabled job
3638
publish-gpr:
39+
# This doesn't work and read
40+
# https://github.com/actions/setup-node/issues/73#issuecomment-599199211
41+
# to know why. Github package repository doens't work for package
42+
# which are not scoped hence not publishing
43+
# Hence, disabling it
44+
if: 1 == 0
3745
needs: build
3846
runs-on: ubuntu-latest
3947
steps:
@@ -42,8 +50,10 @@ jobs:
4250
with:
4351
node-version: 12
4452
registry-url: https://npm.pkg.github.com/
45-
scope: "@amzn"
4653
- run: npm ci
54+
# Read https://joeattardi.codes/2019-11-16-github-package/ to know more
55+
# about this hack. I think the above issue should explain this
56+
- run: echo registry=https://npm.pkg.github.com/amzn >> $NPM_CONFIG_USERCONFIG
4757
- run: npm publish
4858
env:
4959
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "git-commit-template",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "Set commit template for git packages",
55
"bin": {
66
"git-commit-template": "./bin/git-commit-template.js"

0 commit comments

Comments
 (0)