Skip to content

GitHub action to publish an npm package into Azure Artifact

License

Notifications You must be signed in to change notification settings

innerspacetrainings/azure-npm-publish

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

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Azure NPM Publish

GitHub action to automatically publish a NPM package into Azure Artifacts

Setup

Create the file .github/workflows/azure-npm-publish.yml with the following content:

name: Azure Publish

on:
  push:
    tags:
      - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - uses: innerspacetrainings/azure-npm-publish@master
        with:
          package-dir: 'Custom/directory'
          npm-email: '[email protected]'
          organization: 'organization/url'
          feed: 'feed-name'
          username: 'anything-for-the-logs'
          base64-token: ${{ secrets.AZURE_TOKEN }}

Configuration

For reference, I do recommend you to know how to set up the .npmrc file following Microsoft's documentation.

The fields here the following:

Field Required Description
package-dir false The path for the package.json if it is not in root
npm-email true Required email to upload the npm package
organization true Value which replaces <yourOrganization> in the .npmrc file
feed true Value which replaces <yourFeed> in the .npmrc file
username true Any value but not an empty string
base64-token true Value which replaces [BASE64_ENCODED_PERSONAL_ACCESS_TOKEN] in the .npmrc file

About

GitHub action to publish an npm package into Azure Artifact

Resources

License

Stars

Watchers

Forks

Packages

No packages published