Skip to content

Commit

Permalink
ci: [@dependabot] fix npm package-ecosystem x yarn integration
Browse files Browse the repository at this point in the history
  • Loading branch information
unicornware committed Jan 8, 2023
1 parent e0cbd62 commit fafde91
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

---
version: 2
registries:
github:
replaces-base: true
token: ${{ secrets.PAT_BOT }}
type: npm-registry
url: https://npm.pkg.github.com/flex-development
updates:
- package-ecosystem: github-actions
commit-message:
Expand All @@ -31,6 +37,8 @@ updates:
labels:
- scope:dependencies
- type:build
registries:
- github
reviewers:
- flex-development/dependabot-review
- flexdevelopment
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ jobs:
gpr:
needs: metadata
permissions:
contents: write
packages: write
runs-on: ubuntu-latest
environment:
Expand All @@ -68,6 +69,9 @@ jobs:
uses: actions/[email protected]
with:
ref: ${{ format('refs/tags/{0}', env.TAG) }}
- id: npmrc-cleanup
name: Remove stale .npmrc file
run: rm .npmrc
- id: npmrc
name: Setup .npmrc file
uses: actions/[email protected]
Expand All @@ -76,13 +80,18 @@ jobs:
node-version-file: .nvmrc
registry-url: https://npm.pkg.github.com
scope: ${{ github.repository_owner }}
- id: npmrc-print
name: Print contents of .npmrc file
run: cat $NPM_CONFIG_USERCONFIG
- id: publish
name: Publish package
run: npm publish $ARTIFACT ${{ needs.metadata.outputs.dist-tag }}
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
npm:
needs: [metadata, gpr]
permissions:
contents: write
runs-on: ubuntu-latest
environment:
name: npm
Expand All @@ -95,6 +104,9 @@ jobs:
uses: actions/[email protected]
with:
ref: ${{ format('refs/tags/{0}', env.TAG) }}
- id: npmrc-cleanup
name: Remove stale .npmrc file
run: rm .npmrc
- id: npmrc
name: Setup .npmrc file
uses: actions/[email protected]
Expand All @@ -103,6 +115,9 @@ jobs:
node-version-file: .nvmrc
registry-url: https://registry.npmjs.org
scope: ${{ github.repository_owner }}
- id: npmrc-print
name: Print contents of .npmrc file
run: cat $NPM_CONFIG_USERCONFIG
- id: publish
name: Publish package
run: npm publish $ARTIFACT ${{ needs.metadata.outputs.dist-tag }}
Expand Down
5 changes: 5 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# https://docs.npmjs.com/cli/configuring-npm/npmrc

@flex-development:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${PAT_BOT}
//npm.pkg.github.com/:always-auth=true
2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ nodeLinker: node-modules
npmScopes:
flex-development:
npmAlwaysAuth: true
npmAuthToken: ${GITHUB_TOKEN}
npmAuthToken: ${GITHUB_TOKEN:-$PAT_BOT}
npmRegistryServer: https://npm.pkg.github.com

patchFolder: ./patches
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ Follow the steps below to setup your local development environment:
| `GITHUB_TOKEN` |
| `NODE_ENV` |
| `NODE_NO_WARNINGS` |
| `PAT_BOT` |
| `ZSH_DOTENV_FILE` |

#### GitHub Actions
Expand Down

0 comments on commit fafde91

Please sign in to comment.