Skip to content

Commit

Permalink
chore: add documentation reminder issue tracker (#256)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
makspll authored Feb 8, 2025
1 parent b9d92df commit 76d79ae
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/missing-documentation-reminder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Missing Documentation Reminder

on:
workflow_dispatch:
pull_request:
types:
- edited
- closed

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:pr is:merged 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: 1
});
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

0 comments on commit 76d79ae

Please sign in to comment.