forked from nextauthjs/next-auth
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from nextauthjs/feat/oauth4webapi-balazs
- Loading branch information
Showing
77 changed files
with
1,636 additions
and
674 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
!dist | ||
!package-lock.json |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"private": true, | ||
"exports": "./index.mjs", | ||
"scripts": { | ||
"build": "ncc -m -o . build src/index.mjs --license licenses.txt" | ||
}, | ||
"devDependencies": { | ||
"@vercel/ncc": "0.34.0" | ||
}, | ||
"dependencies": { | ||
"@actions/core": "1.10.0", | ||
"@actions/github": "5.1.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
We cannot recreate the issue with the provided information. **Please add a reproduction in order for us to be able to investigate.** | ||
|
||
### **Why was this issue marked with the `incomplete` label?** | ||
|
||
To be able to investigate, we need access to a reproduction to identify what triggered the issue. We prefer a link to a public GitHub repository ([template](https://github.com/nextauthjs/next-auth-example)), but you can also use a tool like [CodeSandbox](https://codesandbox.io/s/github/nextauthjs/next-auth-example/tree/main) or [StackBlitz](https://stackblitz.com/fork/github/nextauthjs/next-auth-example). | ||
|
||
To make sure the issue is resolved as quickly as possible, please make sure that the reproduction is as **minimal** as possible. This means that you should **remove unnecessary code, files, and dependencies** that do not contribute to the issue. | ||
|
||
Please test your reproduction against the latest version of NextAuth.js (`next-auth@latest`) to make sure your issue has not already been fixed. | ||
|
||
### **I added a link, why was it still marked?** | ||
|
||
Ensure the link is pointing to a codebase that is accessible (e.g. not a private repository). "[example.com](http://example.com/)", "n/a", "will add later", etc. are not acceptable links -- we need to see a public codebase. See the above section for accepted links. | ||
|
||
### **What happens if I don't provide a sufficient minimal reproduction?** | ||
|
||
Issues with the `incomplete` label that receives no meaningful activity (e.g. new comments with a reproduction link) are automatically closed and locked after 30 days. | ||
|
||
If your issue has _not_ been resolved in that time and it has been closed/locked, please open a new issue with the required reproduction. | ||
|
||
### **I did not open this issue, but it is relevant to me, what can I do to help?** | ||
|
||
Anyone experiencing the same issue is welcome to provide a minimal reproduction following the above steps. Furthermore, you can upvote the issue using the :+1: reaction on the topmost comment (please **do not** comment "I have the same issue" without repro steps). Then, we can sort issues by votes to prioritize. | ||
|
||
### **I think my reproduction is good enough, why aren't you looking into it quicker?** | ||
|
||
We look into every NextAuth.js issue and constantly monitor open issues for new comments. | ||
|
||
However, sometimes we might miss one or two. We apologize, and kindly ask you to refrain from tagging core maintainers, as that will usually not result in increased priority. | ||
|
||
Upvoting issues to show your interest will help us prioritize and address them as quickly as possible. That said, every issue is important to us, and if an issue gets closed by accident, we encourage you to open a new one linking to the old issue and we will look into it. | ||
|
||
### **Useful Resources** | ||
|
||
- [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) | ||
- [Reporting a NextAuth.js bug](https://github.com/nextauthjs/next-auth/blob/main/.github/ISSUE_TEMPLATE/1_bug_framework.yml) | ||
- [How to Contribute to Open Source (Next.js)](https://www.youtube.com/watch?v=cuoNzXFLitc) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
// @ts-check | ||
// @ts-expect-error | ||
import * as github from "@actions/github" | ||
// @ts-expect-error | ||
import * as core from "@actions/core" | ||
import { readFileSync } from "node:fs" | ||
import { join } from "node:path" | ||
|
||
const addReproductionLabel = "incomplete" | ||
const __dirname = | ||
"/home/runner/work/nextauthjs/next-auth/.github/actions/issue-validator" | ||
|
||
/** | ||
* @typedef {{ | ||
* id :number | ||
* node_id :string | ||
* url :string | ||
* name :string | ||
* description :string | ||
* color :string | ||
* default :boolean | ||
* }} Label | ||
* | ||
* @typedef {{ | ||
* pull_request: any | ||
* issue?: {body: string, number: number, labels: Label[]} | ||
* label: Label | ||
* }} Payload | ||
* | ||
* @typedef {{ | ||
* payload: Payload | ||
* repo: any | ||
* }} Context | ||
*/ | ||
|
||
async function run() { | ||
try { | ||
/** @type {Context} */ | ||
const { payload, repo } = github.context | ||
const { | ||
issue, | ||
pull_request, | ||
label: { name: newLabel }, | ||
} = payload | ||
|
||
if (pull_request || !issue?.body || !process.env.GITHUB_TOKEN) return | ||
|
||
const labels = issue.labels.map((l) => l.name) | ||
// const isBugReport = | ||
// labels.includes(bugLabel) || newLabel === bugLabel || !labels.length | ||
|
||
if ( | ||
// !(isBugReport && issue.number > 43554) && | ||
![addReproductionLabel].includes(newLabel) && | ||
!labels.includes(addReproductionLabel) | ||
) { | ||
return core.info( | ||
"Not a bug report or not manually labeled or already labeled." | ||
) | ||
} | ||
|
||
const client = github.getOctokit(process.env.GITHUB_TOKEN).rest | ||
const issueCommon = { ...repo, issue_number: issue.number } | ||
|
||
if ( | ||
newLabel === addReproductionLabel | ||
// || !hasValidRepro | ||
) { | ||
await Promise.all([ | ||
client.issues.addLabels({ | ||
...issueCommon, | ||
labels: [addReproductionLabel], | ||
}), | ||
client.issues.createComment({ | ||
...issueCommon, | ||
body: readFileSync(join(__dirname, "repro.md"), "utf8"), | ||
}), | ||
]) | ||
return core.info( | ||
"Commented on issue, because it did not have a sufficient reproduction." | ||
) | ||
} | ||
} catch (error) { | ||
core.setFailed(error.message) | ||
} | ||
} | ||
|
||
run() |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Validate issue | ||
on: | ||
issues: | ||
types: [labeled] | ||
|
||
jobs: | ||
validate: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
- name: 'Run issue validator' | ||
run: node ./.github/actions/issue-validator/index.mjs | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.