Skip to content

Commit 637dbbe

Browse files
authored
Modernize workflows (openai#4668)
# External (non-OpenAI) Pull Request Requirements Before opening this Pull Request, please read the dedicated "Contributing" markdown file or your PR may be closed: https://github.com/openai/codex/blob/main/docs/contributing.md If your PR conforms to our contribution guidelines, replace this text with a detailed and high quality description of your changes.
1 parent b95c721 commit 637dbbe

File tree

2 files changed

+82
-17
lines changed

2 files changed

+82
-17
lines changed

.github/workflows/issue-deduplicator.yml

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,35 @@ jobs:
4545
uses: openai/codex-action@main
4646
with:
4747
openai_api_key: ${{ secrets.CODEX_OPENAI_API_KEY }}
48-
prompt_file: .github/prompts/issue-deduplicator.txt
4948
require_repo_write: false
50-
codex_version: 0.43.0-alpha.16
51-
codex_args: -m gpt-5
49+
model: gpt-5
50+
prompt: |
51+
You are an assistant that triages new GitHub issues by identifying potential duplicates.
52+
53+
You will receive the following JSON files located in the current working directory:
54+
- `codex-current-issue.json`: JSON object describing the newly created issue (fields: number, title, body).
55+
- `codex-existing-issues.json`: JSON array of recent issues (each element includes number, title, body, createdAt).
56+
57+
Instructions:
58+
- Load both files as JSON and review their contents carefully. The codex-existing-issues.json file is large, ensure you explore all of it.
59+
- Compare the current issue against the existing issues to find up to five that appear to describe the same underlying problem or request.
60+
- When unsure, prefer returning fewer matches.
61+
- Include at most five numbers.
62+
63+
output_schema: |
64+
{
65+
"type": "object",
66+
"properties": {
67+
"issues": {
68+
"type": "array",
69+
"items": {
70+
"type": "string"
71+
}
72+
}
73+
},
74+
"required": ["issues"],
75+
"additionalProperties": false
76+
}
5277
5378
comment-on-issue:
5479
name: Comment with potential duplicates
@@ -66,22 +91,25 @@ jobs:
6691
with:
6792
github-token: ${{ github.token }}
6893
script: |
69-
let numbers;
94+
const raw = process.env.CODEX_OUTPUT ?? '';
95+
let parsed;
7096
try {
71-
numbers = JSON.parse(process.env.CODEX_OUTPUT);
97+
parsed = JSON.parse(raw);
7298
} catch (error) {
7399
core.info(`Codex output was not valid JSON. Raw output: ${raw}`);
100+
core.info(`Parse error: ${error.message}`);
74101
return;
75102
}
76103
77-
if (numbers.length === 0) {
104+
const issues = Array.isArray(parsed?.issues) ? parsed.issues : [];
105+
if (issues.length === 0) {
78106
core.info('Codex reported no potential duplicates.');
79107
return;
80108
}
81109
82110
const lines = [
83111
'Potential duplicates detected:',
84-
...numbers.map((value) => `- #${value}`),
112+
...issues.map((value) => `- #${String(value)}`),
85113
'',
86114
'*Powered by [Codex Action](https://github.com/openai/codex-action)*'];
87115

.github/workflows/issue-labeler.yml

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ jobs:
1313
runs-on: ubuntu-latest
1414
permissions:
1515
contents: read
16-
env:
17-
ISSUE_NUMBER: ${{ github.event.issue.number }}
18-
ISSUE_TITLE: ${{ github.event.issue.title }}
19-
ISSUE_BODY: ${{ github.event.issue.body }}
20-
REPO_FULL_NAME: ${{ github.repository }}
2116
outputs:
2217
codex_output: ${{ steps.codex.outputs.final_message }}
2318
steps:
@@ -27,9 +22,51 @@ jobs:
2722
uses: openai/codex-action@main
2823
with:
2924
openai_api_key: ${{ secrets.CODEX_OPENAI_API_KEY }}
30-
prompt_file: .github/prompts/issue-labeler.txt
3125
require_repo_write: false
32-
codex_version: 0.43.0-alpha.16
26+
prompt: |
27+
You are an assistant that reviews GitHub issues for the repository.
28+
29+
Your job is to choose the most appropriate existing labels for the issue described later in this prompt.
30+
Follow these rules:
31+
- Only pick labels out of the list below.
32+
- Prefer a small set of precise labels over many broad ones.
33+
34+
Labels to apply:
35+
1. bug — Reproducible defects in Codex products (CLI, VS Code extension, web, auth).
36+
2. enhancement — Feature requests or usability improvements that ask for new capabilities, better ergonomics, or quality-of-life tweaks.
37+
3. extension — VS Code (or other IDE) extension-specific issues.
38+
4. windows-os — Bugs or friction specific to Windows environments (always when PowerShell is mentioned, path handling, copy/paste, OS-specific auth or tooling failures).
39+
5. mcp — Topics involving Model Context Protocol servers/clients.
40+
6. codex-web — Issues targeting the Codex web UI/Cloud experience.
41+
8. azure — Problems or requests tied to Azure OpenAI deployments.
42+
9. documentation — Updates or corrections needed in docs/README/config references (broken links, missing examples, outdated keys, clarification requests).
43+
10. model-behavior — Undesirable LLM behavior: forgetting goals, refusing work, hallucinating environment details, quota misreports, or other reasoning/performance anomalies.
44+
45+
Issue number: ${{ github.event.issue.number }}
46+
47+
Issue title:
48+
${{ github.event.issue.title }}
49+
50+
Issue body:
51+
${{ github.event.issue.body }}
52+
53+
Repository full name:
54+
${{ github.repository }}
55+
56+
output_schema: |
57+
{
58+
"type": "object",
59+
"properties": {
60+
"labels": {
61+
"type": "array",
62+
"items": {
63+
"type": "string"
64+
}
65+
}
66+
},
67+
"required": ["labels"],
68+
"additionalProperties": false
69+
}
3370
3471
apply-labels:
3572
name: Apply labels from Codex output
@@ -53,12 +90,12 @@ jobs:
5390
exit 0
5491
fi
5592
56-
if ! printf '%s' "$json" | jq -e 'type == "array"' >/dev/null 2>&1; then
57-
echo "Codex output was not a JSON array. Raw output: $json"
93+
if ! printf '%s' "$json" | jq -e 'type == "object" and (.labels | type == "array")' >/dev/null 2>&1; then
94+
echo "Codex output did not include a labels array. Raw output: $json"
5895
exit 0
5996
fi
6097
61-
labels=$(printf '%s' "$json" | jq -r '.[] | tostring')
98+
labels=$(printf '%s' "$json" | jq -r '.labels[] | tostring')
6299
if [ -z "$labels" ]; then
63100
echo "Codex returned an empty array. Nothing to do."
64101
exit 0

0 commit comments

Comments
 (0)