Skip to content

Commit 76ea054

Browse files
committed
ci: [@dependabot] fix npm package-ecosystem x yarn integration
- https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#npm-registry Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
1 parent 1fff40f commit 76ea054

File tree

5 files changed

+24
-1
lines changed

5 files changed

+24
-1
lines changed

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66

77
---
88
version: 2
9+
registries:
10+
github:
11+
replaces-base: true
12+
token: ${{ secrets.PAT_BOT }}
13+
type: npm-registry
14+
url: https://npm.pkg.github.com/flex-development
915
updates:
1016
- package-ecosystem: github-actions
1117
commit-message:
@@ -28,6 +34,8 @@ updates:
2834
labels:
2935
- scope:dependencies
3036
- type:build
37+
registries:
38+
- github
3139
reviewers:
3240
- flex-development/dependabot-review
3341
- flexdevelopment

.github/workflows/publish.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ jobs:
5555
gpr:
5656
needs: metadata
5757
permissions:
58+
contents: write
5859
packages: write
5960
runs-on: ubuntu-latest
6061
environment:
@@ -68,6 +69,9 @@ jobs:
6869
uses: actions/checkout@v3.2.0
6970
with:
7071
ref: ${{ format('refs/tags/{0}', env.TAG) }}
72+
- id: npmrc-cleanup
73+
name: Remove stale .npmrc file
74+
run: rm .npmrc
7175
- id: npmrc
7276
name: Setup .npmrc file
7377
uses: actions/setup-node@v3.5.1
@@ -83,6 +87,8 @@ jobs:
8387
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8488
npm:
8589
needs: [metadata, gpr]
90+
permissions:
91+
contents: write
8692
runs-on: ubuntu-latest
8793
environment:
8894
name: npm
@@ -95,6 +101,9 @@ jobs:
95101
uses: actions/checkout@v3.2.0
96102
with:
97103
ref: ${{ format('refs/tags/{0}', env.TAG) }}
104+
- id: npmrc-cleanup
105+
name: Remove stale .npmrc file
106+
run: rm .npmrc
98107
- id: npmrc
99108
name: Setup .npmrc file
100109
uses: actions/setup-node@v3.5.1

.npmrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# https://docs.npmjs.com/cli/configuring-npm/npmrc
2+
3+
@flex-development:registry=https://npm.pkg.github.com
4+
//npm.pkg.github.com/:_authToken=${PAT_BOT}
5+
//npm.pkg.github.com/:always-auth=true

.yarnrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ nodeLinker: node-modules
2121
npmScopes:
2222
flex-development:
2323
npmAlwaysAuth: true
24-
npmAuthToken: ${GITHUB_TOKEN}
24+
npmAuthToken: ${GITHUB_TOKEN:-$PAT_BOT}
2525
npmRegistryServer: https://npm.pkg.github.com
2626

2727
patchFolder: ./patches

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ Follow the steps below to setup your local development environment:
101101
| `GITHUB_TOKEN` |
102102
| `NODE_ENV` |
103103
| `NODE_NO_WARNINGS` |
104+
| `PAT_BOT` |
104105
| `ZSH_DOTENV_FILE` |
105106

106107
#### GitHub Actions

0 commit comments

Comments
 (0)