Skip to content

Commit 11e3701

Browse files
authored
Add Task issue form (#6007)
1 parent cfda559 commit 11e3701

File tree

2 files changed

+111
-0
lines changed

2 files changed

+111
-0
lines changed

.github/ISSUE_TEMPLATE/task.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Task
2+
description: For staff only - Create a task
3+
type: Task
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
## ⚠️ RESTRICTED ACCESS
9+
10+
**This form is restricted to Open Home Foundation staff and authorized contributors only.**
11+
12+
If you are a community member wanting to contribute, please:
13+
- For bug reports: Use the [bug report form](https://github.com/home-assistant/supervisor/issues/new?template=bug_report.yml)
14+
- For feature requests: Submit to [Feature Requests](https://github.com/orgs/home-assistant/discussions)
15+
16+
---
17+
18+
### For authorized contributors
19+
20+
Use this form to create tasks for development work, improvements, or other actionable items that need to be tracked.
21+
- type: textarea
22+
id: description
23+
attributes:
24+
label: Description
25+
description: |
26+
Provide a clear and detailed description of the task that needs to be accomplished.
27+
28+
Be specific about what needs to be done, why it's important, and any constraints or requirements.
29+
placeholder: |
30+
Describe the task, including:
31+
- What needs to be done
32+
- Why this task is needed
33+
- Expected outcome
34+
- Any constraints or requirements
35+
validations:
36+
required: true
37+
- type: textarea
38+
id: additional_context
39+
attributes:
40+
label: Additional context
41+
description: |
42+
Any additional information, links, research, or context that would be helpful.
43+
44+
Include links to related issues, research, prototypes, roadmap opportunities etc.
45+
placeholder: |
46+
- Roadmap opportunity: [link]
47+
- Epic: [link]
48+
- Feature request: [link]
49+
- Technical design documents: [link]
50+
- Prototype/mockup: [link]
51+
- Dependencies: [links]
52+
validations:
53+
required: false
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Restrict task creation
2+
3+
# yamllint disable-line rule:truthy
4+
on:
5+
issues:
6+
types: [opened]
7+
8+
jobs:
9+
check-authorization:
10+
runs-on: ubuntu-latest
11+
# Only run if this is a Task issue type (from the issue form)
12+
if: github.event.issue.issue_type == 'Task'
13+
steps:
14+
- name: Check if user is authorized
15+
uses: actions/github-script@v7
16+
with:
17+
script: |
18+
const issueAuthor = context.payload.issue.user.login;
19+
20+
// Check if user is an organization member
21+
try {
22+
await github.rest.orgs.checkMembershipForUser({
23+
org: 'home-assistant',
24+
username: issueAuthor
25+
});
26+
console.log(`✅ ${issueAuthor} is an organization member`);
27+
return; // Authorized
28+
} catch (error) {
29+
console.log(`❌ ${issueAuthor} is not authorized to create Task issues`);
30+
}
31+
32+
// Close the issue with a comment
33+
await github.rest.issues.createComment({
34+
owner: context.repo.owner,
35+
repo: context.repo.repo,
36+
issue_number: context.issue.number,
37+
body: `Hi @${issueAuthor}, thank you for your contribution!\n\n` +
38+
`Task issues are restricted to Open Home Foundation staff and authorized contributors.\n\n` +
39+
`If you would like to:\n` +
40+
`- Report a bug: Please use the [bug report form](https://github.com/home-assistant/supervisor/issues/new?template=bug_report.yml)\n` +
41+
`- Request a feature: Please submit to [Feature Requests](https://github.com/orgs/home-assistant/discussions)\n\n` +
42+
`If you believe you should have access to create Task issues, please contact the maintainers.`
43+
});
44+
45+
await github.rest.issues.update({
46+
owner: context.repo.owner,
47+
repo: context.repo.repo,
48+
issue_number: context.issue.number,
49+
state: 'closed'
50+
});
51+
52+
// Add a label to indicate this was auto-closed
53+
await github.rest.issues.addLabels({
54+
owner: context.repo.owner,
55+
repo: context.repo.repo,
56+
issue_number: context.issue.number,
57+
labels: ['auto-closed']
58+
});

0 commit comments

Comments
 (0)