-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into side-nav-layout
- Loading branch information
Showing
70 changed files
with
2,054 additions
and
3,520 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,74 @@ | ||
name: "Apply issue labels to PR" | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
|
||
jobs: | ||
label_on_pr: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: none | ||
issues: read | ||
pull-requests: write | ||
|
||
steps: | ||
- name: Apply labels from linked issue to PR | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
async function getLinkedIssues(owner, repo, prNumber) { | ||
const query = `query GetLinkedIssues($owner: String!, $repo: String!, $prNumber: Int!) { | ||
repository(owner: $owner, name: $repo) { | ||
pullRequest(number: $prNumber) { | ||
closingIssuesReferences(first: 10) { | ||
nodes { | ||
number | ||
labels(first: 10) { | ||
nodes { | ||
name | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}`; | ||
const variables = { | ||
owner: owner, | ||
repo: repo, | ||
prNumber: prNumber, | ||
}; | ||
const result = await github.graphql(query, variables); | ||
return result.repository.pullRequest.closingIssuesReferences.nodes; | ||
} | ||
const pr = context.payload.pull_request; | ||
const linkedIssues = await getLinkedIssues( | ||
context.repo.owner, | ||
context.repo.repo, | ||
pr.number | ||
); | ||
const labelsToAdd = new Set(); | ||
for (const issue of linkedIssues) { | ||
if (issue.labels && issue.labels.nodes) { | ||
for (const label of issue.labels.nodes) { | ||
labelsToAdd.add(label.name); | ||
} | ||
} | ||
} | ||
if (labelsToAdd.size) { | ||
await github.rest.issues.addLabels({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: pr.number, | ||
labels: Array.from(labelsToAdd), | ||
}); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { FileX2 } from "lucide-react"; | ||
import Link from "next/link"; | ||
|
||
export default function NotFound() { | ||
return ( | ||
<div className="my-10 flex flex-col items-center justify-center rounded-md bg-white py-12"> | ||
<div className="rounded-full bg-gray-100 p-3"> | ||
<FileX2 className="h-6 w-6 text-gray-600" /> | ||
</div> | ||
<h1 className="my-3 text-xl font-semibold text-gray-700"> | ||
Page Not Found | ||
</h1> | ||
<p className="z-10 max-w-sm text-center text-sm text-gray-600"> | ||
Sorry, we couldn’t find the page you’re looking for. | ||
</p> | ||
<img | ||
src="/_static/illustrations/coffee-call.svg" | ||
alt="No links yet" | ||
width={400} | ||
height={400} | ||
/> | ||
<Link | ||
href="/" | ||
className="z-10 rounded-md border border-black bg-black px-10 py-2 text-sm font-medium text-white transition-all duration-75 hover:bg-white hover:text-black" | ||
> | ||
Back to home | ||
</Link> | ||
</div> | ||
); | ||
} |
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
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
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.