Skip to content

Commit d0cb7db

Browse files
committed
ci: automate gsoc label assignment
- Added a PR template by referring existing templates in preCICE repos. - Added workflow to automatically assign GSoC labels via PR template checkbox.
1 parent 63f84e2 commit d0cb7db

2 files changed

Lines changed: 58 additions & 0 deletions

File tree

.github/pull_request_template.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
## Main Changes of this PR
2+
3+
4+
## Motivation and additional information
5+
6+
<!--
7+
Short rational why preCICE needs this change. If this is already described in an issue a link to that issue (closes #123) is sufficient.
8+
-->
9+
10+
## Steps to Test
11+
12+
13+
## Screenshots (if applicable)
14+
15+
16+
## Author's checklist
17+
18+
* [ ] I ran the website locally and verified the changes.
19+
* [ ] I ensured links and formatting render correctly.
20+
* [ ] I added screenshots if UI/visual changes are introduced.
21+
* [ ] I linked the related issue (if applicable).
22+
* [ ] I squashed commits that belong together.
23+
* [ ] This PR is a part of Google Summer of Code (GSoC)
24+
25+
## Reviewers' checklist
26+
27+
<!-- Tag people next to each point and add points for specific questions -->
28+
29+
* [ ] Does the changelog entry make sense? Is it formatted correctly?
30+
* [ ] Do you understand the code changes?
31+
32+
<!-- add more questions/tasks if necessary -->
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Automatic labelling of GSoC related PRs
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited, synchronize]
6+
7+
jobs:
8+
label-gsoc:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Add GSoC label if checkbox is checked
13+
uses: actions/github-script@v7
14+
with:
15+
script: |
16+
const body = context.payload.pull_request.body || "";
17+
const gsocChecked = body.includes("[x] This PR is a part of Google Summer of Code (GSoC)") ||
18+
body.includes("[X] This PR is a part of Google Summer of Code (GSoC)");
19+
if(gsocChecked) {
20+
await github.rest.issues.addLabels({
21+
owner: context.repo.owner,
22+
repo: context.repo.repo,
23+
issue_number: context.payload.pull_request.number,
24+
labels: ["GSoC"]
25+
});
26+
}

0 commit comments

Comments
 (0)