Skip to content

Commit 3b533eb

Browse files
committed
Add Codex Review pipeline
1 parent 6fe9b63 commit 3b533eb

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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+
});

0 commit comments

Comments
 (0)