Skip to content

Commit f014512

Browse files
PaulDuvallclaude
andcommitted
refactor: convert to on-demand workflow with NPM token input
- Remove push trigger, make workflow_dispatch only - Add secure npm_token input field for user to enter token - Remove AWS SSM Parameter Store dependency - Remove AWS credentials configuration - Simplify token handling with direct input masking - Eliminates setup complexity while maintaining security 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent af6242e commit f014512

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

.github/workflows/npm-publish-simple.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
name: NPM Publish
22

33
on:
4-
push:
5-
branches: [main]
64
workflow_dispatch:
5+
inputs:
6+
npm_token:
7+
description: 'NPM Token (get from https://www.npmjs.com/settings/tokens)'
8+
required: true
9+
type: string
710

811
permissions:
912
id-token: write
@@ -12,7 +15,6 @@ permissions:
1215
jobs:
1316
publish:
1417
runs-on: ubuntu-latest
15-
if: vars.AWS_DEPLOYMENT_ROLE != ''
1618

1719
steps:
1820
- uses: actions/checkout@v4
@@ -22,16 +24,10 @@ jobs:
2224
node-version: '20'
2325
registry-url: 'https://registry.npmjs.org'
2426

25-
- uses: aws-actions/configure-aws-credentials@v4
26-
with:
27-
role-to-assume: ${{ vars.AWS_DEPLOYMENT_ROLE }}
28-
aws-region: ${{ vars.AWS_REGION || 'us-east-1' }}
29-
3027
- name: Configure NPM
3128
run: |
32-
NPM_TOKEN=$(aws ssm get-parameter --name /npm/token --with-decryption --query Parameter.Value --output text)
33-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
34-
echo "::add-mask::$NPM_TOKEN"
29+
echo "//registry.npmjs.org/:_authToken=${{ inputs.npm_token }}" >> ~/.npmrc
30+
echo "::add-mask::${{ inputs.npm_token }}"
3531
3632
- name: Publish
3733
run: npm publish --access public

0 commit comments

Comments
 (0)