Autopilot Operator #2181
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Autopilot Operator | |
| on: | |
| schedule: | |
| - cron: "*/10 * * * *" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| issues: write | |
| pull-requests: write | |
| jobs: | |
| operator: | |
| runs-on: [self-hosted, Windows] | |
| env: | |
| ORG: ${{ vars.ORG }} | |
| GH_TOKEN: ${{ secrets.ORG_AUTOPILOT_TOKEN }} | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| steps: | |
| - name: Ensure Codex on PATH | |
| shell: pwsh | |
| run: | | |
| $codexPath = "C:\Program Files\codex" | |
| if (Test-Path $codexPath) { | |
| "PATH=$codexPath;$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Append | |
| } | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| clean: false | |
| - name: Tool checks | |
| shell: pwsh | |
| run: | | |
| git --version | |
| gh --version | |
| if (Get-Command codex -ErrorAction SilentlyContinue) { | |
| codex --version | |
| } else { | |
| Write-Host "Codex not found on PATH" | |
| exit 1 | |
| } | |
| - name: Validate org mutation token | |
| shell: pwsh | |
| run: | | |
| if (-not $env:GH_TOKEN) { | |
| Write-Host "ORG_AUTOPILOT_TOKEN is not set." | |
| exit 1 | |
| } | |
| - name: Validate Codex auth | |
| shell: pwsh | |
| run: | | |
| if (-not $env:OPENAI_API_KEY) { | |
| Write-Host "OPENAI_API_KEY is not set." | |
| exit 1 | |
| } | |
| - name: Run operator | |
| shell: pwsh | |
| run: .\scripts\autopilot-operator.ps1 |