Skip to content

chore: add github workflow for npm publish #2

chore: add github workflow for npm publish

chore: add github workflow for npm publish #2

Workflow file for this run

---
# Publishing the package to the npm registry when the version number changes
# See https://github.com/marketplace/actions/npm-publish for more information
name: Publish Package to npmjs
on:
push:
branches: main
on:

Check failure on line 10 in .github/workflows/npm_publish.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/npm_publish.yml

Invalid workflow file

You have an error in your yaml syntax on line 10
pull_request:
types:
- opened
- reopened
- edited
- synchronize
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: "20"
- run: npm ci
- run: npm test
- uses: JS-DevTools/npm-publish@v3
id: publish
with:
token: ${{ secrets.NPM_TOKEN }}
- if: ${{ steps.publish.outputs.type }}
run: echo "Published to NPM registry '${{ steps.publish.outputs.name }}' version '${{ steps.publish.outputs.version }}'"