-
Notifications
You must be signed in to change notification settings - Fork 1
37 lines (35 loc) · 1.17 KB
/
Copy pathhide-codex-limit-comments.yml
File metadata and controls
37 lines (35 loc) · 1.17 KB
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
name: Hide Codex Rate Limit Comments
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
jobs:
hide-comment:
runs-on: ubuntu-latest
if: >
github.event.comment.user.login == 'chatgpt-codex-connector[bot]' &&
(
contains(github.event.comment.body, 'usage limit') ||
contains(github.event.comment.body, 'rate limit') ||
contains(github.event.comment.body, 'quota') ||
contains(github.event.comment.body, 'limit reached') ||
contains(github.event.comment.body, 'try again later')
)
permissions:
issues: write
pull-requests: write
steps:
- name: Minimize comment
uses: actions/github-script@v8
with:
script: |
const mutation = `
mutation($id: ID!) {
minimizeComment(input: {subjectId: $id, classifier: OFF_TOPIC}) {
minimizedComment { isMinimized }
}
}
`;
await github.graphql(mutation, { id: context.payload.comment.node_id });
console.log('Minimized codex rate-limit comment:', context.payload.comment.id);