Skip to content

Commit

Permalink
[code-infra] Sync bug issue template (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored Jan 2, 2024
1 parent 64c4102 commit b4de97e
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 16 deletions.
29 changes: 13 additions & 16 deletions .github/ISSUE_TEMPLATE/1.bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ body:
Please provide a searchable summary of the issue in the title above ⬆️.
Thanks for contributing by creating an issue! ❤️
- type: checkboxes
- type: input
attributes:
label: Duplicates
description: Please [search the history](https://github.com/mui/mui-public/issues) to see if an issue already exists for the same problem.
options:
- label: I have searched the existing issues
required: true
label: Search keywords
description: Your issue may have already been reported! List the keywords you've used to search the [existing issues](https://github.com/mui/mui-public/issues). This will also make your issue searchable for others.
placeholder: e.g. datagrid column resizing
validations:
required: true
- type: checkboxes
attributes:
label: Latest version
Expand All @@ -24,34 +24,31 @@ body:
required: true
- type: textarea
attributes:
label: Steps to reproduce 🕹
label: Steps to reproduce
description: |
**⚠️ Issues that we can't reproduce will be closed.**
Please provide a link to a live example and an unambiguous set of steps to reproduce this bug.
**⚠️ Issues that we can't reproduce can't be fixed.**
value: |
Link to live example:
Link to live example: (required)
Steps:
1.
2.
3.
- type: textarea
attributes:
label: Current behavior 😯
label: Current behavior
description: Describe what happens instead of the expected behavior.
- type: textarea
attributes:
label: Expected behavior 🤔
label: Expected behavior
description: Describe what should happen.
- type: textarea
attributes:
label: Context 🔦
label: Context
description: What are you trying to accomplish? How has this issue affected you? Providing context helps us come up with a solution that is more useful in the real world.
- type: textarea
attributes:
label: Your environment 🌎
label: Your environment
description: Run `npx @mui/envinfo` and post the results. If you encounter issues with TypeScript please include the used tsconfig.
value: |
<details>
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/issue-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Cleanup issue comment

on:
issues:
types:
- opened

permissions: {}

jobs:
issue_cleanup:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6
with:
script: |
const issue = await github.rest.issues.get({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
})
const lines = issue.data.body.split('\n')
const _ = extractInputSection(lines, 'Latest version')
const searchKeywords = extractInputSection(lines, 'Search keywords')
const orderID = extractInputSection(lines, 'Order ID or Support key')
lines.push('')
lines.push('**Search keywords**: ' + searchKeywords)
if (orderID !== '' && orderID !== '_No response_') {
lines.push('**Order ID**: ' + orderID)
}
const body = lines.join('\n')
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body,
})
function extractInputSection(lines, title) {
const index = lines.findIndex(line => line.startsWith('###') && line.includes(title))
if (index === -1) {
return ''
}
return lines.splice(index, 4)[2].trim()
}

0 comments on commit b4de97e

Please sign in to comment.