Skip to content

Commit

Permalink
Merge pull request #119 from celo-org/pputman/update-npm-publish-work…
Browse files Browse the repository at this point in the history
…flow-dispatch-check

updating workflow to contain an options check-auth-only input
  • Loading branch information
pputman-clabs authored Apr 8, 2024
2 parents 050e5d3 + 6756ed0 commit a4b329d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/actions/npm-publish/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ inputs:
akeyless-token-path:
description: "Akeyless token path"
required: true
check-auth-only:
description: "Check akeyless token access only"
type: boolean
default: false
required: false

runs:
using: "composite"
Expand All @@ -44,27 +49,32 @@ runs:
# Setup Node JS with input from node version and set the registry url
# (defaults to npm registry)
- name: 'Setup Node JS'
if: ${{ inputs.check-auth-only }} != true
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
registry-url: ${{ inputs.registry-url }}

# Install yarn package manager
- name: 'Setup yarn'
if: ${{ inputs.check-auth-only }} != true
shell: bash
run: |
npm install --global yarn
# Clabs uses yarn so npm ci (the ci/cd version of npm install) won't work
# without a json.package lock file, so must use yarn here too
- uses: bahmutov/npm-install@v1
if: ${{ inputs.check-auth-only }} != true
with:
working-directory: ${{ inputs.install-dir }}

- run: yarn build
if: ${{ inputs.check-auth-only }} != true
shell: bash

- name: Set tag
if: ${{ inputs.check-auth-only }} != true
id: set-tag
shell: bash
run: |
Expand All @@ -85,6 +95,7 @@ runs:
cd ${{ inputs.package-dir }} && \
npm publish --tag ${{ steps.set-tag.outputs.tag }} --provenance --access ${{ inputs.package-access }}
fi
if: ${{ inputs.check-auth-only }} != true
shell: bash
env:
# this is the access token in NPM. Note, even though it recommends
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/npm-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ on:
akeyless-token-path:
required: true
type: string
check-auth-only:
default: false
type: boolean

jobs:

npm-publish:
Expand All @@ -47,3 +51,4 @@ jobs:
akeyless-api-gateway: ${{ inputs.akeyless-api-gateway }}
akeyless-github-access-id: ${{ inputs.akeyless-github-access-id }}
akeyless-token-path: ${{ inputs.akeyless-token-path }}
check-auth-only: ${{ inputs.check-auth-only }}

0 comments on commit a4b329d

Please sign in to comment.