diff --git a/.github/dependabot.yml b/.github/dependabot.yml index c4e6ce9..cb89c8d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -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: @@ -28,6 +34,8 @@ updates: labels: - scope:dependencies - type:build + registries: + - github reviewers: - flex-development/dependabot-review - flexdevelopment diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ea1a009..07cd6eb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -68,6 +68,9 @@ jobs: uses: actions/checkout@v3.2.0 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/setup-node@v3.6.0 @@ -76,6 +79,9 @@ 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 }} @@ -95,6 +101,9 @@ jobs: uses: actions/checkout@v3.2.0 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/setup-node@v3.6.0 @@ -103,6 +112,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 }} diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..a196de9 --- /dev/null +++ b/.npmrc @@ -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 diff --git a/.yarnrc.yml b/.yarnrc.yml index 6dac9ca..e89924d 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -23,7 +23,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 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0a7222b..a70a804 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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