File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed
Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ # Copyright 2025, Intel Corporation
2+ # SPDX-License-Identifier: BSD-3-Clause
3+ name : Codex PR Review
4+
5+ # This workflow does one simple thing - it posts a comment "@codex review" under the name of the person who has
6+ # active OpenAI ChatGPT subscription with Codex integration to this repo enabled. This triggers Codex review.
7+
8+ # To update the token:
9+ # If you have ChatGPT subscription, go to https://chatgpt.com/codex and Click "Enable Code Review".
10+ # After that create your personal (scoped) Github token for ispc org with
11+ # Pull Request and Issues "read and write" permissions and store that token in
12+ # CODEX_TOKEN ispc github org secrets.
13+
14+ on :
15+ pull_request :
16+ types : [opened, reopened]
17+ workflow_dispatch : # Manual trigger
18+ inputs :
19+ pr_number :
20+ description : ' PR number to comment on'
21+ required : true
22+ type : number
23+
24+ jobs :
25+ comment :
26+ runs-on : ubuntu-latest
27+ # The secret is available only in that repo.
28+ if : github.repository == 'ispc/ispc'
29+ steps :
30+ - name : Comment on PR
31+ uses : actions/github-script@v8
32+ with :
33+ github-token : ${{ secrets.CODEX_TOKEN }}
34+ script : |
35+ const pr_number = parseInt(
36+ context.eventName === 'workflow_dispatch'
37+ ? context.payload.inputs.pr_number
38+ : context.issue.number
39+ );
40+
41+ await github.rest.issues.createComment({
42+ issue_number: pr_number,
43+ owner: context.repo.owner,
44+ repo: context.repo.repo,
45+ body: '@codex review'
46+ });
You can’t perform that action at this time.
0 commit comments