Skip to content

Commit 74a9373

Browse files
test oidc auth by forcing empty credentials
1 parent 1e65e20 commit 74a9373

File tree

2 files changed

+86
-0
lines changed

2 files changed

+86
-0
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ jobs:
105105
title: Version Packages - ${{ github.ref_name }}
106106
publish: pnpm release latest
107107
env:
108+
NODE_AUTH_TOKEN: ''
108109
NPM_TOKEN: ''
109110
NPM_CONFIG_PROVENANCE: true
110111
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -133,5 +134,6 @@ jobs:
133134
env:
134135
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
135136
NPM_TOKEN: ''
137+
NODE_AUTH_TOKEN: ''
136138
NPM_CONFIG_PROVENANCE: true
137139
SHOPIFY_CLI_BUILD_REPO: ${{ github.repository }}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Test OIDC Authentication
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: read
8+
id-token: write
9+
10+
env:
11+
PNPM_VERSION: '10.11.1'
12+
13+
jobs:
14+
test-oidc-setup:
15+
name: Test OIDC Setup
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v3
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Setup deps
23+
uses: ./.github/actions/setup-cli-deps
24+
with:
25+
node-version: 24.12.0
26+
27+
- name: Check npm version
28+
run: npm --version
29+
30+
- name: Check Node version
31+
run: node --version
32+
33+
- name: Verify .npmrc configuration
34+
run: |
35+
echo "=== Checking .npmrc files exist ==="
36+
if [ -f ~/.npmrc ]; then
37+
echo "✅ ~/.npmrc exists"
38+
if grep -q "registry.npmjs.org" ~/.npmrc; then
39+
echo "✅ Contains npm registry configuration"
40+
fi
41+
else
42+
echo "ℹ️ No .npmrc in home directory"
43+
fi
44+
45+
if [ -f .npmrc ]; then
46+
echo "✅ ./.npmrc exists in project"
47+
else
48+
echo "ℹ️ No .npmrc in project directory"
49+
fi
50+
51+
- name: Verify environment configuration
52+
run: |
53+
if [ -z "${NODE_AUTH_TOKEN+x}" ]; then
54+
echo "❌ NODE_AUTH_TOKEN not set"
55+
else
56+
echo "✅ NODE_AUTH_TOKEN is configured"
57+
fi
58+
59+
if [ "${NPM_CONFIG_PROVENANCE}" = "true" ]; then
60+
echo "✅ NPM_CONFIG_PROVENANCE is enabled"
61+
else
62+
echo "❌ NPM_CONFIG_PROVENANCE not enabled"
63+
fi
64+
env:
65+
NODE_AUTH_TOKEN: ''
66+
NPM_TOKEN: ''
67+
NPM_CONFIG_PROVENANCE: true
68+
69+
- name: Test npm publish dry-run
70+
run: |
71+
cd packages/cli-kit
72+
npm publish --dry-run --provenance --access public 2>&1 | grep -E "(Publishing|provenance|notice|Published)" || true
73+
env:
74+
NODE_AUTH_TOKEN: ''
75+
NPM_TOKEN: ''
76+
NPM_CONFIG_PROVENANCE: true
77+
78+
- name: Check OIDC token availability
79+
run: |
80+
if [ -n "${ACTIONS_ID_TOKEN_REQUEST_URL+x}" ]; then
81+
echo "✅ OIDC token request URL is available"
82+
else
83+
echo "❌ OIDC token request URL is NOT available"
84+
fi

0 commit comments

Comments
 (0)