Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updating workflow to contain an options check-auth-only input #119

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}