Skip to content

Commit

Permalink
[code-infra] Sync bug issue template (#3029)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored Dec 27, 2023
1 parent f88a894 commit 3cfcff0
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 15 deletions.
30 changes: 15 additions & 15 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-toolpad/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-toolpad/issues). This will also make your issue searchable for others.
placeholder: e.g. canvas resizing
validations:
required: true
- type: checkboxes
attributes:
label: Latest version
Expand All @@ -24,33 +24,33 @@ body:
required: true
- type: textarea
attributes:
label: Steps to reproduce 🕹
label: Steps to reproduce
description: |
Provide a link to a live example and an unambiguous set of steps to reproduce this bug.
Include code to reproduce, if relevant.
**⚠️ Issues that we can't reproduce can't be fixed.**
Issues that we can't reproduce will be closed.
Provide a link to a live example and an unambiguous set of steps to reproduce this bug. Include code to reproduce, if relevant.
value: |
Steps:
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 3cfcff0

Please sign in to comment.