Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Commit

Permalink
Update GFI tweet action (#4876)
Browse files Browse the repository at this point in the history
  • Loading branch information
harshraj8843 authored Dec 5, 2023
1 parent 18bbc44 commit c3dbf15
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ if git diff --cached --name-only | grep -q "^website/" || git diff --cached --na
echo "${RED}${CDR}${NC}: Building code"
pnpm build --filter action 1>/dev/null
echo "${GREEN}${CC}${NC}: We confirm dist/ building."
echo ""
echo "${RED}${CDR}${NC}: Formatting code"
pnpm format:action 1>/dev/null
echo "${GREEN}${CC}${NC}: Roger. We confirm formatting."
fi
fi

Expand Down
4 changes: 3 additions & 1 deletion action/dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion action/src/twitter/good-first-issues/fetch-gfi-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ export default async function FetchGFIData({
// Fetch latest Good First Issues from Github API
const perPage = 1;
const page = 1;
// randomly select "updated" or "created"
const searchMode =
Math.floor(Math.random() * 2) === 0 ? "updated" : "created";
const randomLanguage =
LanguageList[Math.floor(Math.random() * LanguageList.length)];
const requestURL = `https://api.github.com/search/issues?q=is%3Aissue+label%3A%22good+first+issue%22+label%3A${EncodeURI(
randomLanguage,
)}+state:open+no%3Aassignee&sort=updated&order=desc&per_page=${perPage}&page=${page}`;
)}+state:open+no%3Aassignee&sort=${searchMode}&order=desc&per_page=${perPage}&page=${page}`;
// core.debug(`Request URL: ${requestURL}`)
const response: Response = await fetch(requestURL, {
method: "GET",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"format:website": "prettier --write \"website/**/*.{js,jsx,ts,tsx,md,mdx,json,yml,yaml}\"",
"format:packages": "prettier --write \"npm/packages/**/*.{js,jsx,ts,tsx,md,mdx,json,yml,yaml}\"",
"format:examples": "prettier --write \"npm/examples/**/*.{js,jsx,ts,tsx,md,mdx,json,yml,yaml}\"",
"format:action": "prettier --write \"action/**/*.{js,jsx,ts,tsx,md,mdx,json,yml,yaml}\"",
"all": "pnpm clone-submodules && pnpm format && turbo lint && pnpm build:local && pnpm test",
"all:website": "pnpm format:website && pnpm lint:website && pnpm build:local:website && pnpm test:website",
"all:packages": "pnpm format:packages && pnpm lint:packages && pnpm build:packages && pnpm test:packages",
Expand Down

3 comments on commit c3dbf15

@vercel
Copy link

@vercel vercel bot commented on c3dbf15 Dec 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on c3dbf15 Dec 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on c3dbf15 Dec 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.