Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ce67684

Browse files
committedJun 3, 2023
feat: add workflows for experiment labels
1 parent b0198a5 commit ce67684

File tree

1 file changed

+123
-0
lines changed

1 file changed

+123
-0
lines changed
 
+123
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
name: issue experiment
2+
3+
on:
4+
issues:
5+
types: [labeled]
6+
7+
jobs:
8+
issue-experiment-proposed:
9+
if: github.event.label.name == format('experiment{0} proposed', ':')
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/github-script@v6
13+
with:
14+
github-token: ${{secrets.GH_PAT}}
15+
script: |
16+
github.rest.issues.createComment({
17+
issue_number: context.issue.number,
18+
owner: context.repo.owner,
19+
repo: context.repo.repo,
20+
body: 'This issue has been marked as an experiment proposal! :test_tube: It will now enter a period of consultation during which we encourage the community to provide feedback on the proposed design. Please see the [experiment workflow documentation](https://taskfile.dev/experiments/workflow) for more information on how we release experiments.'
21+
})
22+
issue-experiment-draft:
23+
if: github.event.label.name == format('experiment{0} draft', ':')
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/github-script@v6
27+
with:
28+
github-token: ${{secrets.GH_PAT}}
29+
script: |
30+
github.rest.issues.createComment({
31+
issue_number: context.issue.number,
32+
owner: context.repo.owner,
33+
repo: context.repo.repo,
34+
body: 'This experiment has been marked as a draft! :sparkles: This means that an initial implementation has been added to the latest release of Task! You can find information about this experiment and how to enable it in our [experiments documentation](https://taskfile.dev/experiments). Please see the [experiment workflow documentation](https://taskfile.dev/experiments/workflow) for more information on how we release experiments.'
35+
})
36+
issue-experiment-candidate:
37+
if: github.event.label.name == format('experiment{0} candidate', ':')
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/github-script@v6
41+
with:
42+
github-token: ${{secrets.GH_PAT}}
43+
script: |
44+
github.rest.issues.createComment({
45+
issue_number: context.issue.number,
46+
owner: context.repo.owner,
47+
repo: context.repo.repo,
48+
body: 'This experiment has been marked as a candidate! :fire: This means that the implementation is nearing completion and we are entering a period for final comments and feedback! You can find information about this experiment and how to enable it in our [experiments documentation](https://taskfile.dev/experiments). Please see the [experiment workflow documentation](https://taskfile.dev/experiments/workflow) for more information on how we release experiments.'
49+
})
50+
issue-experiment-stable:
51+
if: github.event.label.name == format('experiment{0} stable', ':')
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/github-script@v6
55+
with:
56+
github-token: ${{secrets.GH_PAT}}
57+
script: |
58+
github.rest.issues.createComment({
59+
issue_number: context.issue.number,
60+
owner: context.repo.owner,
61+
repo: context.repo.repo,
62+
body: 'This experiment has been marked as stable! :metal: This means that the implementation is now final and ready to be released. No more changes will be made and the experiment is safe to use in production! You can find information about this experiment and how to enable it in our [experiments documentation](https://taskfile.dev/experiments). Please see the [experiment workflow documentation](https://taskfile.dev/experiments/workflow) for more information on how we release experiments.'
63+
})
64+
issue-experiment-released:
65+
if: github.event.label.name == format('experiment{0} released', ':')
66+
runs-on: ubuntu-latest
67+
steps:
68+
- uses: actions/github-script@v6
69+
with:
70+
github-token: ${{secrets.GH_PAT}}
71+
script: |
72+
github.rest.issues.createComment({
73+
issue_number: context.issue.number,
74+
owner: context.repo.owner,
75+
repo: context.repo.repo,
76+
body: 'This experiment has been released! :rocket: This means that it is no longer an experiment and is available in the latest major version of Task. Please see the [experiment workflow documentation](https://taskfile.dev/experiments/workflow) for more information on how we release experiments.'
77+
})
78+
github.rest.issues.update({
79+
issue_number: context.issue.number,
80+
owner: context.repo.owner,
81+
repo: context.repo.repo,
82+
state: 'closed'
83+
})
84+
issue-experiment-abandoned:
85+
if: github.event.label.name == format('experiment{0} abandoned', ':')
86+
runs-on: ubuntu-latest
87+
steps:
88+
- uses: actions/github-script@v6
89+
with:
90+
github-token: ${{secrets.GH_PAT}}
91+
script: |
92+
github.rest.issues.createComment({
93+
issue_number: context.issue.number,
94+
owner: context.repo.owner,
95+
repo: context.repo.repo,
96+
body: 'This experiment has been abandoned. :disappointed: This means that this feature will not be added to Task and any experimental functionality will be removed. Please see the [experiment workflow documentation](https://taskfile.dev/experiments/workflow) for more information on how we release experiments.'
97+
})
98+
github.rest.issues.update({
99+
issue_number: context.issue.number,
100+
owner: context.repo.owner,
101+
repo: context.repo.repo,
102+
state: 'closed'
103+
})
104+
issue-experiment-superseded:
105+
if: github.event.label.name == format('experiment{0} superseded', ':')
106+
runs-on: ubuntu-latest
107+
steps:
108+
- uses: actions/github-script@v6
109+
with:
110+
github-token: ${{secrets.GH_PAT}}
111+
script: |
112+
github.rest.issues.createComment({
113+
issue_number: context.issue.number,
114+
owner: context.repo.owner,
115+
repo: context.repo.repo,
116+
body: 'This experiment has been superseded. :seedling: This means that another experiment has replaced this one. Please see the [experiment workflow documentation](https://taskfile.dev/experiments/workflow) for more information on how we release experiments.'
117+
})
118+
github.rest.issues.update({
119+
issue_number: context.issue.number,
120+
owner: context.repo.owner,
121+
repo: context.repo.repo,
122+
state: 'closed'
123+
})

0 commit comments

Comments
 (0)
Please sign in to comment.