actions/npm/publish/action.yaml

44 lines
1.2 KiB
YAML
Raw Permalink Normal View History

2024-01-07 16:55:05 -05:00
name: NPM Publish
description: Push to registry
inputs:
owner:
type: string
required: false
description: Owner to publish to
default: ${{github.repository_owner}}
registry:
type: string
required: false
description: NPM registry FQDM
default: ${{github.server_url}}/api/packages/${{inputs.owner}}/npm/
token:
type: string
required: false
description: Access Token
default: ${{secrets.DEPLOY_TOKEN}}
branch:
type: string
required: false
description: Only publish for branch
default: develop
2024-06-25 10:13:36 -04:00
binary:
type: string
required: false
description: Which NPM/Yarn/Bun executable to use
default: npm
2024-04-27 23:45:29 -04:00
working-directory:
type: string
requried: false
description: Run from path
default: .
2024-01-07 16:55:05 -05:00
runs:
using: composite
steps:
- name: Publish
if: ${{github.ref_name}} == ${{inputs.branch}}
uses: docker://node
with:
2024-06-25 10:13:36 -04:00
args: /bin/bash -c 'cd ${{inputs.working-directory}} && ${{inputs.binary}} set registry ${{inputs.registry}} && ${{inputs.binary}} set $(echo ${{inputs.registry}} | sed s%http:%% | sed s%https:%% ):_authToken "${{inputs.token}}" && ${{inputs.binary}} publish || echo Already published...'