Skip to content

Commit

Permalink
chore(github-workflow): test bankrupt-issues
Browse files Browse the repository at this point in the history
  • Loading branch information
samcx committed Jun 10, 2024
1 parent 73d484d commit 9a74e26
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 17 deletions.
6 changes: 3 additions & 3 deletions .github/actions/next-repo-actions/dist/bankrupt/index.js

Large diffs are not rendered by default.

40 changes: 26 additions & 14 deletions .github/actions/next-repo-actions/src/bankrupt-issues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,37 @@ async function main() {

const octokit = getOctokit(process.env.GITHUB_TOKEN)
const { owner, repo } = context.repo
const query = `repo:${owner}/${repo} is:issue is:open created:2020-01-01..2020-12-31`
// let issue_number: number[] = []
// const query = `repo:${owner}/${repo} is:issue is:open created:2020-01-01..2020-12-31`
const commentBody = `
Hello everyone,
Here is the [bug report](https://github.com/vercel/next.js/issues/new?assignees=&labels=bug&projects=&template=1.bug_report.yml).
Thank you for your understanding and contributions!
Best regards,
The Next.js Team, @samcx
`

// let issues: number[] = []

try {
info(`Query: ${query}`) // Debugging: print the query
const { data } = await octokit.rest.search.issuesAndPullRequests({
q: query,
per_page: 50,
})
// const { data } = await octokit.rest.search.issuesAndPullRequests({
// q: query,
// })

info(`Total # of issues = ${data.items.length}`)
info(`Response data: ${JSON.stringify(data, null, 2)}`)
// info(`Total # of issues = ${data.items.length}`)

// await octokit.rest.issues.createComment({
// owner,
// repo,
// issue_number,
// body: 'Hello world!',
// data.items.forEach((issue) => {
// issues.push(issue.number)
// })

await octokit.rest.issues.createComment({
owner,
repo,
issue_number: 66573,
body: commentBody,
})
} catch (error) {
setFailed(error)
}
Expand Down

0 comments on commit 9a74e26

Please sign in to comment.