Skip to content

Commit

Permalink
Extract reminders to a separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
aeisenberg committed Nov 25, 2024
1 parent d1b8556 commit 8512644
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
7 changes: 7 additions & 0 deletions .github/pr-comment-reminder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### Pull Request reminders for autofix

(internal access required)

- [ ] Autofixes generated based on these changes are valid, only needed if this PR makes significant changes to `.ql`, `.qll`, or `.qhelp` files. See [the documentation](https://github.com/github/codeql-team/blob/main/docs/best-practices/validating-autofix-for-query-changes.md).
- [ ] Changes to autofix are validated [at scale](https://github.com/github/codeql-dca/blob/main/doc/autofix.md).
- [ ] Adding a new query? Consider also [adding the query to autofix](https://github.com/github/codeml-autofix/blob/main/docs/updating-query-support.md#adding-a-new-query-to-the-query-suite).
14 changes: 4 additions & 10 deletions .github/workflows/check-change-note-and-reminders.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,11 @@ jobs:

- name: Check if the 'reminders' comment exists
run: |
checklist_comment=$(gh api "repos/$REPO/issues/$PULL_REQUEST_NUMBER/comments" --jq '.[] | select(.body | test("### Pull Request checklist"))')
reminder_comment=$(gh api "repos/$REPO/issues/$PULL_REQUEST_NUMBER/comments" --jq '.[] | select(.body | test("### Pull Request reminders for autofix"))')
if [ -z "$checklist_comment" ]; then
echo "The checklist comment does not exist. Adding it."
comment_body="$(cat <<EOF
### Pull Request checklist for autofix (internal access required)
- [ ] Autofixes generated based on these changes are valid, only needed if this PR makes significant changes to `.ql`, `.qll`, or `.qhelp` files. See [the documentation](https://github.com/github/codeql-team/blob/main/docs/best-practices/validating-autofix-for-query-changes.md).
- [ ] Changes to autofix are validated [at scale](https://github.com/github/codeql-dca/blob/main/doc/autofix.md) (internal access required).
- [ ] Adding a new query? Consider also [adding the query to autofix](https://github.com/github/codeml-autofix/blob/main/docs/updating-query-support.md#adding-a-new-query-to-the-query-suite).
EOF)"
if [ -z "$reminder_comment" ]; then
echo "The reminder comment does not exist. Adding it."
comment_body="$(cat .github/pr-comment-reminder.md)"
gh api "repos/$REPO/issues/$PULL_REQUEST_NUMBER/comments" -f body="$comment_body"
fi
Expand Down

0 comments on commit 8512644

Please sign in to comment.