Skip to content

Commit 1fde7ff

Browse files
authored
fix: publish-theme action uses secrets.NPM_TOKEN (#1180)
1 parent 6a5a8aa commit 1fde7ff

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

.github/workflows/publish-theme.yaml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- master
7+
workflow_dispatch:
78

89
jobs:
910
look_for_change:
@@ -31,7 +32,7 @@ jobs:
3132
3233
publish:
3334
needs: look_for_change
34-
if: needs.look_for_change.outputs.theme_changed == 'true'
35+
if: ${{ needs.look_for_change.outputs.theme_changed == 'true' || github.event_name == 'workflow_dispatch' }}
3536
runs-on: ubuntu-latest
3637
steps:
3738
- uses: actions/checkout@v4
@@ -45,32 +46,27 @@ jobs:
4546
cache: 'npm'
4647
cache-dependency-path: 'package-lock.json'
4748
always-auth: 'true'
48-
registry-url: 'https://npm.pkg.github.com/'
49-
scope: '@apify-packages'
50-
env:
51-
NODE_AUTH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_NPM_TOKEN }}
5249

5350
- name: Setup git user and npm
5451
run: |
5552
git config --global user.name "Apify Release Bot"
5653
git config --global user.email "noreply@apify.com"
5754
58-
echo "access=public" > .npmrc
59-
echo "//registry.npmjs.org/:_authToken=${{ secrets.APIFY_SERVICE_ACCOUNT_NPM_TOKEN }}" >> .npmrc
55+
echo "access=public" > ~/.npmrc
56+
echo "@apify-packages:registry=https://npm.pkg.github.com/" >> ~/.npmrc
57+
echo "//registry.npmjs.org/:_authToken=${{ secrets.APIFY_SERVICE_ACCOUNT_NPM_TOKEN }}" >> ~/.npmrc
58+
echo "//npm.pkg.github.com/:_authToken=${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}" >> ~/.npmrc
6059
6160
- name: Bump the theme version
6261
run: |
6362
cd $GITHUB_WORKSPACE/apify-docs-theme
6463
npm version patch --legacy-peer-deps
65-
env:
66-
NODE_AUTH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_NPM_TOKEN }}
6764
6865
- name: Deploy theme to npm
6966
run: |
7067
cd $GITHUB_WORKSPACE/apify-docs-theme
7168
npx -y publish-if-not-exists
7269
env:
73-
NPM_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_NPM_TOKEN }}
7470
GIT_USER: "barjin:${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}"
7571
GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
7672

0 commit comments

Comments
 (0)