-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(github): add issue_wrong_template workflow (#73882)
## Why? Mini-automation to automatically close issues when using the `please use the correct issue template` label.
- Loading branch information
Showing
6 changed files
with
979 additions
and
728 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
.github/actions/next-repo-actions/dist/wrong-issue-template/index.js
Large diffs are not rendered by default.
Oops, something went wrong.
612 changes: 612 additions & 0 deletions
612
.github/actions/next-repo-actions/dist/wrong-issue-template/licenses.txt
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
38 changes: 38 additions & 0 deletions
38
.github/actions/next-repo-actions/src/wrong-issue-template.ts
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 @@ | ||
import { info, setFailed } from '@actions/core' | ||
import { context, getOctokit } from '@actions/github' | ||
|
||
async function main() { | ||
if (!process.env.GITHUB_TOKEN) throw new TypeError('GITHUB_TOKEN not set') | ||
|
||
const octokit = getOctokit(process.env.GITHUB_TOKEN) | ||
|
||
const { owner, repo } = context.repo | ||
const issue = context.payload.issue | ||
const body = ` | ||
This issue has been closed due to the incorrect issue template being used. Please make sure to submit a new issue using the [correct issue template](https://github.com/vercel/next.js/issues/new?assignees=&labels=bug&projects=&template=1.bug_report.yml). This will ensure that we have all the necessary information to triage your issue. Thank you. | ||
` | ||
|
||
try { | ||
await octokit.rest.issues.createComment({ | ||
owner, | ||
repo, | ||
issue_number: issue.number, | ||
body, | ||
}) | ||
|
||
await octokit.rest.issues.update({ | ||
owner, | ||
repo, | ||
issue_number: issue.number, | ||
state: 'closed', | ||
}) | ||
|
||
info( | ||
`Issue #${issue.number}, which was opened with the incorrect template, has been successfully closed.` | ||
) | ||
} catch (error) { | ||
setFailed(error) | ||
} | ||
} | ||
|
||
main() |
Oops, something went wrong.
8e64b2c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stats from current release
Default Build (Increase detected⚠️ )
General Overall increase⚠️
Client Bundles (main, webpack) Overall increase⚠️
Legacy Client Bundles (polyfills)
Client Pages
Client Build Manifests
Rendered Page Sizes
Edge SSR bundle Size Overall increase⚠️
Middleware size Overall increase⚠️
Next Runtimes Overall increase⚠️
build cache Overall increase⚠️
Diff details
Diff for page.js
Diff for middleware.js
Diff too large to display
Diff for edge-ssr.js
Diff too large to display
Diff for image-HASH.js
Diff for 1187-HASH.js
Diff too large to display
Diff for 8377-HASH.js
Diff for main-HASH.js
Diff too large to display
Diff for app-page-exp..ntime.dev.js
Diff for app-page-exp..time.prod.js
Diff too large to display
Diff for app-page-tur..time.prod.js
Diff too large to display
Diff for app-page-tur..time.prod.js
Diff too large to display
Diff for app-page.runtime.dev.js
Diff for app-page.runtime.prod.js
Diff too large to display
Diff for app-route-ex..ntime.dev.js
Diff too large to display
Diff for app-route-ex..time.prod.js
Diff too large to display
Diff for app-route-tu..time.prod.js
Diff too large to display
Diff for app-route-tu..time.prod.js
Diff too large to display
Diff for app-route.runtime.dev.js
Diff too large to display
Diff for app-route.ru..time.prod.js
Diff too large to display
Diff for pages-api-tu..time.prod.js
Diff too large to display
Diff for pages-api.runtime.dev.js
Diff too large to display
Diff for pages-api.ru..time.prod.js
Diff too large to display
Diff for pages-turbo...time.prod.js
Diff too large to display
Diff for pages.runtime.dev.js
Diff too large to display
Diff for pages.runtime.prod.js
Diff too large to display
Diff for server.runtime.prod.js
8e64b2c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stats from current release
Default Build (Increase detected⚠️ )
General Overall increase⚠️
Client Bundles (main, webpack) Overall increase⚠️
Legacy Client Bundles (polyfills)
Client Pages
Client Build Manifests
Rendered Page Sizes
Edge SSR bundle Size Overall increase⚠️
Middleware size Overall increase⚠️
Next Runtimes Overall increase⚠️
build cache Overall increase⚠️
Diff details
Diff for page.js
Diff for middleware.js
Diff too large to display
Diff for edge-ssr.js
Diff too large to display
Diff for image-HASH.js
Diff for 1187-HASH.js
Diff too large to display
Diff for 8377-HASH.js
Diff for main-HASH.js
Diff too large to display
Diff for app-page-exp..ntime.dev.js
Diff for app-page-exp..time.prod.js
Diff too large to display
Diff for app-page-tur..time.prod.js
Diff too large to display
Diff for app-page-tur..time.prod.js
Diff too large to display
Diff for app-page.runtime.dev.js
Diff for app-page.runtime.prod.js
Diff too large to display
Diff for app-route-ex..ntime.dev.js
Diff too large to display
Diff for app-route-ex..time.prod.js
Diff too large to display
Diff for app-route-tu..time.prod.js
Diff too large to display
Diff for app-route-tu..time.prod.js
Diff too large to display
Diff for app-route.runtime.dev.js
Diff too large to display
Diff for app-route.ru..time.prod.js
Diff too large to display
Diff for pages-api-tu..time.prod.js
Diff too large to display
Diff for pages-api.runtime.dev.js
Diff too large to display
Diff for pages-api.ru..time.prod.js
Diff too large to display
Diff for pages-turbo...time.prod.js
Diff too large to display
Diff for pages.runtime.dev.js
Diff too large to display
Diff for pages.runtime.prod.js
Diff too large to display
Diff for server.runtime.prod.js