-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (73 loc) · 2.91 KB
/
Copy pathfixer.yml
File metadata and controls
82 lines (73 loc) · 2.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: CI Autopilot Fixer
on:
workflow_dispatch:
repository_dispatch:
types: [ci-autopilot]
schedule:
- cron: "0 2 * * *"
permissions:
contents: read
issues: read
jobs:
fixer:
runs-on: [self-hosted, Windows]
timeout-minutes: 20
defaults:
run:
shell: pwsh
env:
GH_TOKEN: ${{ github.token }}
GITHUB_TOKEN: ${{ github.token }}
steps:
- name: Checkout clean workspace
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
clean: true
fetch-depth: 1
- name: Preflight diagnostics
run: |
New-Item -ItemType Directory -Force logs | Out-Null
"Runner: $env:RUNNER_NAME" | Out-File -FilePath logs\preflight.log
"Repo: $env:GITHUB_REPOSITORY" | Out-File -FilePath logs\preflight.log -Append
"Workspace: $env:GITHUB_WORKSPACE" | Out-File -FilePath logs\preflight.log -Append
whoami | Out-File -FilePath logs\preflight.log -Append
Get-Command git -ErrorAction SilentlyContinue | Out-File -FilePath logs\preflight.log -Append
git --version 2>&1 | Out-File -FilePath logs\preflight.log -Append
if (Get-Command python -ErrorAction SilentlyContinue) { python --version 2>&1 | Out-File -FilePath logs\preflight.log -Append }
if (Get-Command py -ErrorAction SilentlyContinue) { py -3 --version 2>&1 | Out-File -FilePath logs\preflight.log -Append }
if (Get-Command gh -ErrorAction SilentlyContinue) { gh --version 2>&1 | Out-File -FilePath logs\preflight.log -Append }
"C:\\src\\ci-autopilot exists: $(Test-Path C:\\src\\ci-autopilot)" | Out-File -FilePath logs\preflight.log -Append
- name: Python diagnostics
run: |
if (Get-Command python -ErrorAction SilentlyContinue) {
python --version
} elseif (Get-Command py -ErrorAction SilentlyContinue) {
py -3 --version
} else {
throw "Python not found in PATH."
}
- name: Create venv
run: |
$py = Get-Command python -ErrorAction SilentlyContinue
if ($py) {
& $py.Source -m venv .venv
return
}
$pyLauncher = Get-Command py -ErrorAction SilentlyContinue
if ($pyLauncher) {
& $pyLauncher.Source -3 -m venv .venv
return
}
throw "Python not found for venv creation."
- name: Install dependencies
run: .\.venv\Scripts\python -m pip install -r requirements.txt
- name: Run CI Autopilot
run: |
.\.venv\Scripts\python -m agent.poll_once 2>&1 | Tee-Object -FilePath logs\run.log
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
- name: Upload logs
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: ci-autopilot-logs
path: logs\*.log