Skip to content

Commit 2e4115d

Browse files
ci: add authentication verification to SDK deprecate workflow
1 parent dfc2dfd commit 2e4115d

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

.github/workflows/sdk-deprecate-npm.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,39 +15,45 @@ jobs:
1515
steps:
1616
- name: Checkout code
1717
uses: actions/checkout@v4
18-
18+
1919
- name: Set up Node.js
2020
uses: actions/setup-node@v4
2121
with:
2222
node-version: '18'
2323
registry-url: 'https://registry.npmjs.org'
24-
24+
2525
- name: Authenticate to npm
2626
run: |
2727
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
28-
28+
echo "Registry URL: https://registry.npmjs.org"
29+
echo "Auth token configured"
30+
2931
- name: Check if package version exists
3032
working-directory: packages/sdk
3133
run: |
3234
echo "Checking if version ${{ github.event.inputs.package_version }} exists..."
3335
if npm view @iexec/dataprotector@${{ github.event.inputs.package_version }} version > /dev/null 2>&1; then
34-
echo "Version ${{ github.event.inputs.package_version }} exists in registry"
36+
echo "Version ${{ github.event.inputs.package_version }} exists in registry"
3537
else
36-
echo "Version ${{ github.event.inputs.package_version }} does not exist in registry"
37-
echo "This might be a nightly/staging version that was never published to the public registry."
38+
echo "❌ Version ${{ github.event.inputs.package_version }} does not exist in registry"
3839
echo "Available versions:"
3940
npm view @iexec/dataprotector versions --json | tail -10
4041
exit 1
4142
fi
42-
43+
44+
- name: Verify authentication
45+
run: |
46+
echo "Verifying npm authentication..."
47+
npm whoami
48+
4349
- name: Deprecate package
4450
working-directory: packages/sdk
4551
run: |
4652
if [ -n "${{ github.event.inputs.package_version }}" ]; then
4753
echo "Deprecating @iexec/dataprotector@${{ github.event.inputs.package_version }}"
4854
npm deprecate @iexec/dataprotector@${{ github.event.inputs.package_version }} "deprecate ${{ github.event.inputs.package_version }}"
49-
echo " Successfully deprecated version ${{ github.event.inputs.package_version }}"
55+
echo " Successfully deprecated version ${{ github.event.inputs.package_version }}"
5056
else
51-
echo "Package version is not set"
57+
echo "Package version is not set"
5258
exit 1
5359
fi

0 commit comments

Comments
 (0)