|
55 | 55 | "metadata": {},
|
56 | 56 | "source": [
|
57 | 57 | "```yaml\n",
|
58 |
| - "\n", |
59 | 58 | "name: Codex Auto-Fix on Failure\n",
|
60 | 59 | "\n",
|
61 | 60 | "on:\n",
|
|
86 | 85 | " echo \"OPENAI_API_KEY secret is not set. Skipping auto-fix.\" >&2\n",
|
87 | 86 | " exit 1\n",
|
88 | 87 | " fi\n",
|
89 |
| - "\n", |
90 | 88 | " - name: Checkout Failing Ref\n",
|
91 | 89 | " uses: actions/checkout@v4\n",
|
92 | 90 | " with:\n",
|
|
102 | 100 | " - name: Install dependencies\n",
|
103 | 101 | " run: |\n",
|
104 | 102 | " if [ -f package-lock.json ]; then npm ci; else npm i; fi\n",
|
105 |
| - "\n", |
106 | 103 | " - name: Run Codex\n",
|
107 | 104 | " uses: openai/codex-action@main\n",
|
108 | 105 | " id: codex\n",
|
109 | 106 | " with:\n",
|
110 | 107 | " openai_api_key: ${{ secrets.OPENAI_API_KEY }}\n",
|
111 |
| - " prompt: \"\"You are working in a Node.js monorepo with Jest tests and GitHub Actions. Read the repository, run the test suite, identify the minimal change needed to make all tests pass, implement only that change, and stop. Do not refactor unrelated code or files. Keep changes small and surgical.\"\n", |
| 108 | + " prompt: \"You are working in a Node.js monorepo with Jest tests and GitHub Actions. Read the repository, run the test suite, identify the minimal change needed to make all tests pass, implement only that change, and stop. Do not refactor unrelated code or files. Keep changes small and surgical.\"\n", |
| 109 | + " codex_args: '[\"--config\",\"sandbox_mode=\\\"workspace-write\\\"\"]'\n", |
112 | 110 | "\n",
|
113 | 111 | " - name: Verify tests\n",
|
114 | 112 | " run: npm test --silent\n",
|
|
118 | 116 | " uses: peter-evans/create-pull-request@v6\n",
|
119 | 117 | " with:\n",
|
120 | 118 | " commit-message: \"fix(ci): auto-fix failing tests via Codex\"\n",
|
121 |
| - " branch: codex/auto-fix-${{ github.event.workflow_run.id }}\n", |
| 119 | + " branch: codex/auto-fix-${{ github.event.workflow_run.run_id }}\n", |
122 | 120 | " base: ${{ env.FAILED_HEAD_BRANCH }}\n",
|
123 | 121 | " title: \"Auto-fix failing CI via Codex\"\n",
|
124 | 122 | " body: |\n",
|
125 | 123 | " Codex automatically generated this PR in response to a CI failure on workflow `${{ env.FAILED_WORKFLOW_NAME }}`.\n",
|
126 |
| - "\n", |
127 | 124 | " Failed run: ${{ env.FAILED_RUN_URL }}\n",
|
128 | 125 | " Head branch: `${{ env.FAILED_HEAD_BRANCH }}`\n",
|
129 |
| - "\n", |
130 | 126 | " This PR contains minimal changes intended solely to make the CI pass.\n",
|
131 | 127 | "```\n"
|
132 | 128 | ]
|
|
0 commit comments