-
-
Notifications
You must be signed in to change notification settings - Fork 39
57 lines (46 loc) · 1.72 KB
/
missing-documentation-reminder.yml
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
name: Missing Documentation Reminder
on:
workflow_dispatch:
push:
branches:
- main
jobs:
find-missing-documentation:
permissions:
contents: read
pull-requests: read
issues: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Find closed PRs with 'needs documentation' label
uses: actions/github-script@v6
id: find-prs
with:
script: |
const query = `repo:makspll/bevy_mod_scripting is:closed label:"needs documentation"`;
const encodedQuery = encodeURIComponent(query);
console.log(encodedQuery);
const { data: { items: pullRequests } } = await github.rest.search.issuesAndPullRequests({
q: query,
per_page: 100
});
console.log(pullRequests)
const prsNeedingDocs = pullRequests.map(pr => `- [ ] ${pr.html_url} by @${pr.user.login}`).join("\n");
if (!prsNeedingDocs) {
return "- [x] All PRs with 'needs documentation' label have been updated in the book.";
} else {
return prsNeedingDocs;
}
result-encoding: string
- name: Update Issue Body
uses: julien-deramond/update-issue-body@v1
with:
issue-number: 255
body: |
This is an automatically generated issue.
The following PRs have been closed but still need updates in the book:
${{ steps.find-prs.outputs.result }}
If you are an author of one of these PRs, please consider updating the boook in `/docs` with appropriate documentation.
Thank you!
edit-mode: replace