Skip to content

Commit

Permalink
secret as parameter and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nichlaes committed Oct 31, 2024
1 parent bf8422a commit 2303973
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/lib-ms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ jobs:
node-version: ${{ needs.get_version.outputs.node-version }}
registry-url: 'https://npm.pkg.github.com/'
directory: servers/lib
secrets: inherit
secrets:
NPM_TOKEN: ${{ secrets.NPM_GITHUB_TOKEN }}

publish-package-npm:
if: |
Expand All @@ -155,7 +156,8 @@ jobs:
node-version: ${{ needs.get_version.outputs.node-version }}
registry-url: 'https://registry.npmjs.org'
directory: servers/lib
secrets: inherit
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN}}

publish-docker-image-ghcr:
if: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ on:
package-name:
default: ''
type: string

env:
NODE_VERSION: 20
secrets:
NPM_TOKEN:
required: true

jobs:
publish-package:
Expand All @@ -36,7 +36,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
node-version: ${{ inputs.node-version }}
always-auth: true
registry-url: ${{ inputs.registry-url }}

Expand Down
4 changes: 3 additions & 1 deletion docs/developer/github-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ from [docker hub](hub.docker.com):
| `DOCKERHUB_SCOPE` | Username or organization name on docker hub |
| `DOCKERHUB_USERNAME` | Username on docker hub |
| `DOCKERHUB_TOKEN` | API token to publish images to docker hub, with `Read`, `Write` and `Delete` permissions |
| `NPM_TOKEN` | Token to publish npm package to Nodejs registry. |
| `NPM_GITHUB_TOKEN` | Token to publish npm package to Github registry |

Remember to add these secrets to
[Github Secrets Setting](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository)
of your fork.
of your fork.

0 comments on commit 2303973

Please sign in to comment.