diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..58c7154524 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly + cooldown: + default-days: 14 + groups: + github-actions: + patterns: + - "*" diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index e9792b182b..5afdafe5b4 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -18,10 +18,10 @@ jobs: language: ["javascript"] steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2 with: languages: ${{ matrix.language }} - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2 diff --git a/.github/workflows/issue-labeler.yml b/.github/workflows/issue-labeler.yml index 8346f20ff5..62056d54bd 100644 --- a/.github/workflows/issue-labeler.yml +++ b/.github/workflows/issue-labeler.yml @@ -11,7 +11,7 @@ jobs: name: Triage runs-on: ubuntu-latest steps: - - uses: github/issue-labeler@v2.5 + - uses: github/issue-labeler@ccca1e16fcb66762200e616fc29b57b940c1cb67 # v3.5 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" configuration-path: ".github/issue-labeler.yml" diff --git a/.github/workflows/issue-validator.yml b/.github/workflows/issue-validator.yml index 8869171a55..5f85b26393 100644 --- a/.github/workflows/issue-validator.yml +++ b/.github/workflows/issue-validator.yml @@ -7,11 +7,11 @@ jobs: validate: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: - node-version: 18 + node-version: 24.14 - name: 'Run issue validator' run: node ./.github/actions/issue-validator/index.mjs env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pkg.pr.new.yml b/.github/workflows/pkg.pr.new.yml index db2172ae7e..0adfce56f8 100644 --- a/.github/workflows/pkg.pr.new.yml +++ b/.github/workflows/pkg.pr.new.yml @@ -8,39 +8,38 @@ on: pull_request: env: - # NODE_VER: 24.14 - NODE_VER: 18.20 + NODE_VER: 24.14 WORKING_DIR: packages/next-auth defaults: run: - working-directory: ${{ env.WORKING_DIR }} + working-directory: packages/next-auth jobs: build: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 + - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 name: Install pnpm with: run_install: false - # cache-dependency-path: ${{ env.WORKING_DIR }}/pnpm-lock.yaml + cache_dependency_path: ${{ env.WORKING_DIR }}/pnpm-lock.yaml - name: Use Node.js ${{ env.NODE_VER }} - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: ${{ env.NODE_VER }} cache: pnpm - # cache-dependency-path: ${{ env.WORKING_DIR }}/pnpm-lock.yaml + cache-dependency-path: ${{ env.WORKING_DIR }}/pnpm-lock.yaml - - name: Install deps - run: pnpm i + - name: Install dependencies + run: pnpm i --frozen-lockfile - # - name: Build and pack - # run: pnpm prepack + - name: Build and pack + run: pnpm build - # - name: Publish package preview - # run: pnpx pkg-pr-new publish --compact + - name: Publish package preview + run: pnpm exec pkg-pr-new publish --compact --packageManager=npm,pnpm,yarn diff --git a/.github/workflows/pr-labeler.yml b/.github/workflows/pr-labeler.yml index 960b43b2a1..ff328ced4c 100644 --- a/.github/workflows/pr-labeler.yml +++ b/.github/workflows/pr-labeler.yml @@ -10,7 +10,7 @@ jobs: name: Triage runs-on: ubuntu-latest steps: - - uses: actions/labeler@v4 + - uses: actions/labeler@bf12e9b00b37c5c0ca2b87b79b2daf7891dbda13 # v7.0.0 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" configuration-path: ".github/pr-labeler.yml" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ba90d200cd..0c036bba9e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,33 +1,76 @@ -name: Release +name: Release on NPM on: - push: - branches: - - "main" - - "beta" - - "next" - - "3.x" - - "v4" - pull_request: - workflow_dispatch: + release: + types: [published] # runs when a GitHub Release is published + +permissions: + contents: read + id-token: write # required for npm provenance + +env: + NODE_VER: 24.14 + CI: true + +defaults: + run: + working-directory: packages/next-auth jobs: - test: - name: Test + publish: + name: Publish package from release tag + # Run only when tag is in the format `vX.Y.Z` produced by `npm version` + if: startsWith(github.event.release.tag_name, 'v') runs-on: ubuntu-latest + env: + TAG: ${{ github.event.release.tag_name }} + steps: - - name: Init - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + - name: Check out the tag referenced by this release + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: - fetch-depth: 2 + ref: ${{ github.event.release.tag_name }} + fetch-depth: 0 + - name: Install pnpm - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 - - name: Setup Node - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f + uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 + with: + run_install: false + + - name: Setup Node.js and pnpm + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: - node-version: 18 - cache: pnpm - - name: Install dependencies - run: pnpm install - - name: Build - run: pnpm build + node-version: ${{ env.NODE_VER }} + cache: 'pnpm' + # This is required for `setup-node` to generate the registry URL into .npmrc + # See https://github.com/actions/setup-node/blob/5e2628c959b9ade56971c0afcebbe5332d44b398/action.yml#L17-L18 + registry-url: 'https://registry.npmjs.org/' + + - name: Verify tag matches package.json version + run: | + PKG_VERSION=$(node -p "require('./package.json').version") + if [ "v$PKG_VERSION" != "$TAG" ]; then + echo "::error ::Tag ($TAG) does not match package.json version (v$PKG_VERSION)" + exit 1 + fi + + - name: Install deps + run: | + pnpm --version + pnpm install --frozen-lockfile + + # Note: no build step because npm publish would run `prepublishOnly` script which builds the package + + - name: Publish to npm with provenance + run: | + # Stable release (vX.Y.Z) + if echo "$TAG" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+$'; then + npm publish --provenance --access public + + # Pre-release (vX.Y.Z-*) + elif echo "$TAG" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+-'; then + npm publish --provenance --access public --tag next + + else + echo "Not a valid release tag ($TAG), skipping publish." + fi diff --git a/.gitignore b/.gitignore index ff09fe228b..215f5ab1da 100644 --- a/.gitignore +++ b/.gitignore @@ -26,17 +26,17 @@ dist # Generated files .docusaurus .cache-loader -packages/next-auth/providers -packages/next-auth/src/providers/oauth-types.ts -packages/next-auth/client -packages/next-auth/css -packages/next-auth/utils -packages/next-auth/core -packages/next-auth/jwt -packages/next-auth/react -packages/next-auth/*.d.ts* -packages/next-auth/*.js -packages/next-auth/next +/packages/next-auth/providers/** +/packages/next-auth/src/providers/oauth-types.ts +/packages/next-auth/client/** +/packages/next-auth/css/** +/packages/next-auth/utils/** +/packages/next-auth/core/** +/packages/next-auth/jwt/** +/packages/next-auth/react/** +/packages/next-auth/*.d.ts* +/packages/next-auth/*.js +/packages/next-auth/next/** # Development app apps/dev/src/css diff --git a/docs/docs/configuration/options.md b/docs/docs/configuration/options.md index b9e68bbee9..359f873cb3 100644 --- a/docs/docs/configuration/options.md +++ b/docs/docs/configuration/options.md @@ -393,6 +393,8 @@ theme: { } ``` +The `brandColor` and `buttonText` values are rendered as escaped text inside a `