Skip to content

ashtonG is publishing to npm #3

ashtonG is publishing to npm

ashtonG is publishing to npm #3

Workflow file for this run

name: publish-to-npm
run-name: ${{ github.actor }} is publishing to npm
on:
workflow_dispatch:
inputs:
bump_level:
description: type of version bump
type: choice
default: patch
required: true
options:
- patch
- minor
- major
- custom (use custom_bump_level)
custom_bump_level:
description: version to bump to
type: string
jobs:
build-and-publish:
name: build and publish package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-tags: true
- uses: actions/setup-node@v3
with:
node-version-file: './.nvmrc'
cache: npm
- name: "install deps"
run: npm ci
- name: "export login token"
env:
NPM_TOKEN: ${{ secrets.NPM_CLASSIC_TOKEN }}
run: "echo //registry.npmjs.org/:_authToken=$NPM_TOKEN > ./.npmrc"
- if: ${{ inputs.bump_level != "custom" }}

Check failure on line 38 in .github/workflows/publish-to-npm.yml

View workflow run for this annotation

GitHub Actions / publish-to-npm

Invalid workflow file

The workflow is not valid. .github/workflows/publish-to-npm.yml (Line: 38, Col: 13): Unexpected symbol: '"custom"'. Located at position 22 within expression: inputs.bump_level != "custom" .github/workflows/publish-to-npm.yml (Line: 43, Col: 13): Unexpected symbol: '"custom"'. Located at position 22 within expression: inputs.bump_level == "custom"
name: "bump version"
env:
VERSION: ${{ inputs.bump_level }}
run: "npm version $VERSION --dry-run"
- if: ${{ inputs.bump_level == "custom" }}
name: "custom version bump"
env:
VERSION ${{ inputs.custom_bump_level }}
run: "[ -n $VERSION ] && npm version $VERSION --dry-run || (echo 'custom version indicated but not set' && false)"
- name: "publishing"
run: "npm publish --dry-run"