forked from rupali-codes/LinksHub
-
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.
- Loading branch information
Showing
48 changed files
with
1,210 additions
and
522 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Close Old Issues | ||
on: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
|
||
jobs: | ||
close-issues: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Close Old Issues | ||
run: | | ||
open_issues=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | ||
"https://api.github.com/repos/${{ github.repository }}/issues?state=open" \ | ||
| jq -r '.[] | .number') | ||
for issue in $open_issues; do | ||
# Get the last updated timestamp of the issue | ||
last_updated=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | ||
"https://api.github.com/repos/${{ github.repository }}/issues/$issue" \ | ||
| jq -r '.updated_at') | ||
days_since_update=$(( ( $(date +%s) - $(date -d "$last_updated" +%s) ) / 86400 )) | ||
if [ $days_since_update -gt 45 ]; then | ||
curl -s -X PATCH -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | ||
-H "Accept: application/vnd.github.v3+json" \ | ||
-d '{"state":"closed"}' \ | ||
"https://api.github.com/repos/${{ github.repository }}/issues/$issue" | ||
fi | ||
done |
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,39 @@ | ||
name: Close Old PRs | ||
on: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
|
||
jobs: | ||
close_old_prs: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check and Close Old PRs | ||
id: close_prs | ||
uses: actions/github-script@v6 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
script: | | ||
const daysThreshold = 45; | ||
const octokit = require('@octokit/rest')(); | ||
octokit.authenticate({ | ||
type: 'token', | ||
token: process.env.GITHUB_TOKEN, | ||
}); | ||
const { owner, repo } = context.repo; | ||
const { data: pullRequests } = await octokit.pulls.list({ owner, repo, state: 'open' }); | ||
pullRequests.forEach(async (pr) => { | ||
const { data: reviews } = await octokit.pulls.listReviews({ owner, repo, pull_number: pr.number }); | ||
const lastReview = reviews[reviews.length - 1]; | ||
const daysSinceLastUpdate = Math.floor((new Date() - new Date(lastReview.submitted_at)) / (1000 * 60 * 60 * 24)); | ||
if (daysSinceLastUpdate >= daysThreshold) { | ||
await octokit.pulls.update({ owner, repo, pull_number: pr.number, state: 'closed' }); | ||
} | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,30 @@ | ||
import { FC } from "react"; | ||
import { Searchbar } from "../Searchbar"; | ||
import useSidebarSearch from "hooks/useSidebarSearch"; | ||
import classNames from "classnames"; | ||
import { useTheme } from "next-themes"; | ||
import { SideNavbarCategoryList } from "./SideNavbarCategoryList"; | ||
import { FC } from 'react' | ||
import { Searchbar } from '../Searchbar' | ||
import useSidebarSearch from 'hooks/useSidebarSearch' | ||
import classNames from 'classnames' | ||
import { useTheme } from 'next-themes' | ||
import { SideNavbarCategoryList } from './SideNavbarCategoryList' | ||
|
||
export const SideNavbarBody:FC<{}> = () => { | ||
const { theme } = useTheme(); | ||
export const SideNavbarBody: FC<{}> = () => { | ||
const { theme } = useTheme() | ||
|
||
const { setSearch, searchResults, debouncedSearch } = useSidebarSearch() | ||
|
||
const { setSearch, searchResults } = useSidebarSearch(); | ||
|
||
return ( | ||
<div | ||
className={classNames( | ||
`bg-base-200 h-full w-full overflow-x-hidden whitespace-nowrap transition-all duration-300 ease-in dark:bg-gray-900 dark:text-gray-300`, | ||
theme === "light" ? "scrollColorLight" : "scrollColorDark" | ||
theme === 'light' ? 'scrollColorLight' : 'scrollColorDark' | ||
)} | ||
> | ||
<div className="bg-base-200 transiton-all w-full p-4 duration-300 ease-in dark:bg-gray-900"> | ||
<Searchbar setSearch={setSearch} /> | ||
</div> | ||
<SideNavbarCategoryList items={searchResults} openByDefault={'frontend'} /> | ||
<SideNavbarCategoryList | ||
items={searchResults} | ||
isSearching={debouncedSearch.length > 0} | ||
openByDefault={'frontend'} | ||
/> | ||
</div> | ||
); | ||
}; | ||
) | ||
} |
Oops, something went wrong.