Skip to content

geoblink/publish-to-npm

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Build Status NPM package version Greenkeeper badge

@geoblink/publish-to-npm

GitHub action to automatically publish package to NPM if they are not already published.

Usage

Create a new .github/workflows/publish-to-npm.yml file:

name: publish-to-npm
on:
  push:
    branches:
      - master # Change this to your default branch
jobs:
  publish-to-npm:
    name: publish-to-npm
    runs-on: ubuntu-latest
    steps:
    - name: Checkout repository
      uses: actions/checkout@master
    - name: Set up Node.js
      uses: actions/setup-node@master
      with:
        node-version: 12.0.0
    - name: Publish version
      uses: geoblink/publish-to-npm@v1.0.2
      env:
        NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} # You must set this in your repo settings

Environment variables

  • NPM_AUTH_TOKEN: this is the token the action will use to authenticate to NPM. You most generate one with publishing permissions in NPM, then you can add it to your secrets (Settings » Secrets) so that it can be passed to the action. DO NOT put the token directly in your workflow file.

About

GitHub action to publish an NPM package if not already published

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •