Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/codex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:

jobs:
codex:
if: github.event_name == 'workflow_dispatch' || github.event.label.name == 'codex-review' || github.event.label.name == 'codex-attempt' || github.event.label.name == 'codex-triage'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Make label gating action-safe and actually enable manual runs.

  • workflow_dispatch will never trigger because it’s not listed under on:.
  • Guard github.event.label.name behind action == 'labeled' so issues.opened events don’t evaluate a missing label field.

Apply:

 on:
+  workflow_dispatch:
   issues:
     types: [opened, labeled]
   pull_request:
     branches: [main]
     types: [labeled]

 jobs:
   codex:
-    if: github.event_name == 'workflow_dispatch' || github.event.label.name == 'codex-review' || github.event.label.name == 'codex-attempt' || github.event.label.name == 'codex-triage'
+    if: |
+      github.event_name == 'workflow_dispatch' ||
+      (github.event.action == 'labeled' &&
+        contains(fromJSON('["codex-review","codex-attempt","codex-triage"]'), github.event.label.name))

Also applies to: 3-9

🤖 Prompt for AI Agents
.github/workflows/codex.yml around line 12 (also apply same fix to lines 3-9):
the if condition uses github.event_name == 'workflow_dispatch' which will never
be true because workflow_dispatch isn't declared under on:, and it checks
github.event.label.name without ensuring the event is 'labeled' which can cause
issues for other events; update the workflow to include workflow_dispatch under
on: so manual runs are allowed, and change the if to gate label checks behind
github.event_name == 'labeled' (e.g. github.event_name == 'workflow_dispatch' ||
(github.event_name == 'labeled' && (github.event.label.name == 'codex-review' ||
github.event.label.name == 'codex-attempt' || github.event.label.name ==
'codex-triage'))), then apply the same corrections to the other condition blocks
on lines 3-9.

runs-on: ubuntu-latest
permissions:
contents: write
Expand Down