Skip to content

Commit 76d79ae

Browse files
authored
chore: add documentation reminder issue tracker (#256)
* chore: add documentation reminder issue tracker * make it run on pr events * add push event to test * use paginated search instead * strip strings * only use merged PR's * format query * add logging and remove q= * log better * add pull request read permissions * test simpler query * try even simpler query * even simpler * try something else * scope by repo * repo scope properly * remove potenial for accidental linkage * dont encode query * add fulll repo string * actually find what I want * don't run on push events * tag user * add notice of auto-generation
1 parent b9d92df commit 76d79ae

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Missing Documentation Reminder
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
types:
7+
- edited
8+
- closed
9+
10+
jobs:
11+
find-missing-documentation:
12+
permissions:
13+
contents: read
14+
pull-requests: read
15+
issues: write
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Find closed PRs with 'needs documentation' label
21+
uses: actions/github-script@v6
22+
id: find-prs
23+
with:
24+
script: |
25+
26+
const query = `repo:makspll/bevy_mod_scripting is:pr is:merged is:closed label:"needs documentation"`;
27+
const encodedQuery = encodeURIComponent(query);
28+
29+
console.log(encodedQuery);
30+
31+
const { data: { items: pullRequests } } = await github.rest.search.issuesAndPullRequests({
32+
q: query,
33+
per_page: 1
34+
});
35+
36+
console.log(pullRequests)
37+
38+
const prsNeedingDocs = pullRequests.map(pr => `- [ ] ${pr.html_url} by @${pr.user.login}`).join("\n");
39+
if (!prsNeedingDocs) {
40+
return "- [x] All PRs with 'needs documentation' label have been updated in the book.";
41+
} else {
42+
return prsNeedingDocs;
43+
}
44+
result-encoding: string
45+
46+
- name: Update Issue Body
47+
uses: julien-deramond/update-issue-body@v1
48+
with:
49+
issue-number: 255
50+
body: |
51+
This is an automatically generated issue.
52+
53+
The following PRs have been closed but still need updates in the book:
54+
${{ steps.find-prs.outputs.result }}
55+
56+
If you are an author of one of these PRs, please consider updating the boook in `/docs` with appropriate documentation.
57+
Thank you!
58+
edit-mode: replace

0 commit comments

Comments
 (0)