Repository navigation
68 lines (64 loc) · 3.1 KB
/
Copy pathtask_contribution.yml
File metadata and controls
68 lines (64 loc) · 3.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: task contribution
# A proposal or a pull request for a new example task gets one comment: thanks,
# what happens next, and on a pull request the maintainer's checklist for
# crediting it, so a contribution is never merged without the credit it earned.
#
# pull_request_target, so it can comment on pull requests from forks. It never
# checks out or runs the contributor's code, which is what makes that safe.
on:
issues:
types: [opened]
pull_request_target:
types: [opened]
paths:
- "src/qikly/inputs_public/config/tasks/**"
- "src/qikly/inputs_public/data/**"
permissions:
issues: write
pull-requests: write
jobs:
proposal:
if: github.event_name == 'issues' && contains(github.event.issue.labels.*.name, 'task proposal')
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
with:
script: |
const author = context.payload.issue.user.login;
const body = [
`Thank you @${author}. A task from a domain the bundled examples do not cover is the contribution that helps this project most.`,
"",
"The maintainer will reply here about scope before you write fixtures. Everything a task needs, and the checks to run before opening a pull request, is in [CONTRIBUTING.md](https://github.com/gal-a/qikly/blob/main/CONTRIBUTING.md).",
].join("\n");
await github.rest.issues.createComment({
owner: context.repo.owner, repo: context.repo.repo,
issue_number: context.payload.issue.number, body,
});
pull-request:
if: github.event_name == 'pull_request_target'
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
with:
script: |
const author = context.payload.pull_request.user.login;
const body = [
`Thank you @${author}, a new example task is the contribution that helps this project most.`,
"",
"Once it is merged you are credited in the changelog for the release that ships it, and you can add this badge to your profile or README:",
"",
"```markdown",
"[](https://test.qikly.com/?ref=contributor)",
"```",
"",
"**Maintainer checklist before merging**",
"- [ ] the task id follows the naming rules in CONTRIBUTING.md, which `tests/test_bundled_task_names.py` enforces",
"- [ ] `qikly --validate --tasks <TASK_ID>` is clean",
"- [ ] a real run converged, or the pull request explains the stall",
"- [ ] `tests/test_demo_claims.py` and every doc that counts the bundled tasks are updated",
`- [ ] @${author} credited in the CHANGELOG entry for the release, and told about the badge`,
].join("\n");
await github.rest.issues.createComment({
owner: context.repo.owner, repo: context.repo.repo,
issue_number: context.payload.pull_request.number, body,
});