-
Notifications
You must be signed in to change notification settings - Fork 359
Enforcing template with a workflow #5021
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Vidal Ortega (vidorteg)
merged 3 commits into
main
from
user/vidorteg/fix-issue-template
Sep 15, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,84 @@ | ||
| name: Bug report | ||
| description: Report a problem with Microsoft Edge Tools for VS Code | ||
| title: "[Bug] " | ||
| labels: | ||
| - bug | ||
| body: | ||
| - type: markdown | ||
| attributes: | ||
| value: | | ||
| Thanks for taking the time to report a problem. | ||
|
|
||
| Before submitting, search existing issues to avoid creating a duplicate and review the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). | ||
|
|
||
| - type: input | ||
| id: operating-system | ||
| attributes: | ||
| label: Operating system | ||
| description: Include the operating system name and version. | ||
| placeholder: Windows 11 24H2 | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: input | ||
| id: extension-version | ||
| attributes: | ||
| label: Extension version | ||
| description: Find this by selecting Microsoft Edge Tools in the VS Code Extensions view. | ||
| placeholder: 2.1.11 | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: input | ||
| id: vscode-version | ||
| attributes: | ||
| label: Visual Studio Code version | ||
| description: Find this under Help > About. | ||
| placeholder: 1.136.0 | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: textarea | ||
| id: bug-description | ||
| attributes: | ||
| label: Bug description | ||
| description: Clearly describe what went wrong. | ||
| placeholder: Describe the problem and when it occurs. | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: textarea | ||
| id: steps-to-reproduce | ||
| attributes: | ||
| label: Steps to reproduce | ||
| description: Provide the smallest sequence of steps that reproduces the problem. | ||
| placeholder: | | ||
| 1. Open ... | ||
| 2. Select ... | ||
| 3. Observe ... | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: textarea | ||
| id: expected-behavior | ||
| attributes: | ||
| label: Expected behavior | ||
| description: Describe what you expected to happen. | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: textarea | ||
| id: additional-context | ||
| attributes: | ||
| label: Additional context | ||
| description: Add logs, screenshots, or other relevant details. Remove sensitive information first. | ||
|
|
||
| - type: checkboxes | ||
| id: checks | ||
| attributes: | ||
| label: Submission checks | ||
| options: | ||
| - label: I searched existing issues and did not find a duplicate. | ||
| required: true | ||
| - label: I have provided enough information for someone else to reproduce or investigate the problem. | ||
| required: true | ||
This file contains hidden or 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 @@ | ||
| blank_issues_enabled: false |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,51 @@ | ||
| name: Feature request | ||
|
vidorteg marked this conversation as resolved.
|
||
| description: Suggest an improvement to Microsoft Edge Tools for VS Code | ||
| title: "[Feature] " | ||
| labels: | ||
| - enhancement | ||
| body: | ||
| - type: markdown | ||
| attributes: | ||
| value: | | ||
| Thanks for suggesting an improvement. | ||
|
|
||
| Before submitting, search existing issues to avoid creating a duplicate and review the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). | ||
|
|
||
| - type: textarea | ||
| id: problem | ||
| attributes: | ||
| label: Problem | ||
| description: Describe the developer problem or limitation this request would address. | ||
| placeholder: I am unable to ... because ... | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: textarea | ||
| id: proposed-solution | ||
| attributes: | ||
| label: Proposed solution | ||
| description: Describe the behavior or experience you would like. | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: textarea | ||
| id: alternatives | ||
| attributes: | ||
| label: Alternatives considered | ||
| description: Describe any workarounds or alternative solutions you have tried. | ||
|
|
||
| - type: textarea | ||
| id: additional-context | ||
| attributes: | ||
| label: Additional context | ||
| description: Add screenshots, examples, or other relevant details. | ||
|
|
||
| - type: checkboxes | ||
| id: checks | ||
| attributes: | ||
| label: Submission checks | ||
| options: | ||
| - label: I searched existing issues and did not find a duplicate. | ||
| required: true | ||
| - label: This request is specifically about Microsoft Edge Tools for VS Code. | ||
| required: true | ||
This file contains hidden or 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,128 @@ | ||
| name: Validate issue submission | ||
|
|
||
| on: | ||
| issues: | ||
| types: | ||
| - opened | ||
|
|
||
| permissions: | ||
| contents: read | ||
| issues: write | ||
|
|
||
| jobs: | ||
| validate: | ||
| if: >- | ||
| contains(github.event.issue.labels.*.name, 'bug') || | ||
| contains(github.event.issue.labels.*.name, 'enhancement') | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Close clearly incomplete submissions | ||
| uses: actions/github-script@v9 | ||
| with: | ||
| script: | | ||
| const association = context.payload.issue.author_association; | ||
| if (['OWNER', 'MEMBER', 'COLLABORATOR'].includes(association)) { | ||
| return; | ||
| } | ||
|
|
||
| const issue = context.payload.issue; | ||
| const labelNames = issue.labels.map(label => | ||
| typeof label === 'string' ? label : label.name | ||
| ); | ||
| const isBug = labelNames.includes('bug'); | ||
| const requiredSections = isBug | ||
| ? [ | ||
| 'Operating system', | ||
| 'Extension version', | ||
| 'Visual Studio Code version', | ||
| 'Bug description', | ||
| 'Steps to reproduce', | ||
| 'Expected behavior', | ||
| ] | ||
| : ['Problem', 'Proposed solution']; | ||
|
|
||
| const sections = new Map(); | ||
| let currentSection; | ||
| for (const line of (issue.body || '').split(/\r?\n/)) { | ||
| const heading = line.match(/^###\s+(.+?)\s*$/); | ||
| if (heading) { | ||
| currentSection = heading[1]; | ||
| sections.set(currentSection, []); | ||
| } else if (currentSection) { | ||
| sections.get(currentSection).push(line); | ||
| } | ||
| } | ||
|
|
||
| const values = requiredSections.map(section => { | ||
| const lines = sections.get(section); | ||
| return lines ? lines.join('\n').trim() : undefined; | ||
| }); | ||
| const junkValues = new Set([ | ||
| '', | ||
| '-', | ||
| '.', | ||
| 'n/a', | ||
| 'na', | ||
| 'none', | ||
| 'no', | ||
| 'test', | ||
| 'testing', | ||
| 'todo', | ||
| '_no response_', | ||
| ]); | ||
| const isJunk = value => { | ||
| if (value === undefined) { | ||
| return true; | ||
| } | ||
|
|
||
| const normalized = value.toLowerCase().trim(); | ||
| return junkValues.has(normalized) || | ||
| normalized.length < 3 || | ||
| /^([^\p{L}\p{N}])\1*$/u.test(normalized) || | ||
| /^([\p{L}\p{N}])\1{2,}$/u.test(normalized); | ||
| }; | ||
|
|
||
| const missingCount = values.filter(value => value === undefined).length; | ||
| const junkCount = values.filter(isJunk).length; | ||
|
|
||
| // Be deliberately conservative: close only malformed form submissions | ||
| // or submissions with multiple unmistakably meaningless answers. | ||
| const invalid = missingCount > 0 || junkCount >= 2; | ||
| if (!invalid) { | ||
| return; | ||
| } | ||
|
|
||
| const labels = [...new Set([...labelNames, 'invalid'])]; | ||
| await github.rest.issues.update({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: issue.number, | ||
| state: 'closed', | ||
| state_reason: 'not_planned', | ||
| labels, | ||
| }); | ||
|
|
||
| await github.rest.issues.createComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: issue.number, | ||
| body: [ | ||
| 'Closing this as it does not contain enough information to investigate.', | ||
| '', | ||
| 'If this is a genuine request for Microsoft Edge Tools for VS Code, please open a new issue and complete all required fields with meaningful details.', | ||
| '', | ||
| ...(isBug | ||
| ? [ | ||
| '- Your operating system, VS Code version, and extension version', | ||
| '- A clear description of the bug', | ||
| '- Steps to reproduce', | ||
| '- Expected behavior', | ||
| ] | ||
|
Copilot marked this conversation as resolved.
|
||
| : [ | ||
| '- The developer problem or limitation', | ||
| '- The behavior or solution you are proposing', | ||
| ]), | ||
| '', | ||
| 'Thanks!', | ||
| ].join('\n'), | ||
| }); | ||
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.