-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtask-appendix-review-fixes.patch
More file actions
158 lines (153 loc) · 7.83 KB
/
Copy pathtask-appendix-review-fixes.patch
File metadata and controls
158 lines (153 loc) · 7.83 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
diff --git a/.github/workflows/agents-keepalive-loop.yml b/.github/workflows/agents-keepalive-loop.yml
index c0d0a2d..5df9b8e 100644
--- a/.github/workflows/agents-keepalive-loop.yml
+++ b/.github/workflows/agents-keepalive-loop.yml
@@ -311,26 +311,44 @@ jobs:
for (const [key, value] of Object.entries(output)) {
core.setOutput(key, value);
}
- // Task appendix needs special handling due to multiline content
- // Write to file to avoid GitHub's secret scanner blocking job outputs
+
+ // Task appendix: Write directly to file to avoid GitHub's secret scanner
+ // blocking job outputs (which happens with long/repetitive content).
+ // Writing here (before setOutput) ensures the content reaches the artifact
+ // even if the output gets censored.
+ const fs = require('fs');
+ const path = require('path');
+ const artifactsDir = '/tmp/keepalive-artifacts';
+ const appendixPath = path.join(artifactsDir, 'task-appendix.txt');
+
+ // Ensure artifacts directory exists
+ fs.mkdirSync(artifactsDir, { recursive: true });
+
+ // Write the full task appendix directly to the artifact file
+ if (result.taskAppendix && result.taskAppendix.length > 0) {
+ fs.writeFileSync(appendixPath, result.taskAppendix + '\n', { encoding: 'utf8' });
+ core.info(`Task appendix written directly to file (${result.taskAppendix.length} chars)`);
+ } else {
+ // Create an empty file if there is no appendix content
+ fs.closeSync(fs.openSync(appendixPath, 'w'));
+ core.info('Empty task appendix file created');
+ }
+
+ // Keep output for backward compatibility (may be censored, but that's OK now)
core.setOutput('task_appendix', result.taskAppendix || '');
- - name: Write task appendix to file
+ - name: Verify task appendix artifact
if: steps.evaluate.outputs.action == 'run' || steps.evaluate.outputs.action == 'fix' || steps.evaluate.outputs.action == 'conflict'
run: |
- mkdir -p /tmp/keepalive-artifacts
- if [ -n "$TASK_APPENDIX" ]; then
- printf '%s\n' "$TASK_APPENDIX" > /tmp/keepalive-artifacts/task-appendix.txt
- else
- touch /tmp/keepalive-artifacts/task-appendix.txt
+ if [ ! -f /tmp/keepalive-artifacts/task-appendix.txt ]; then
+ echo "ERROR: Task appendix file not created by evaluate step"
+ exit 1
fi
- echo "Task appendix written ($(wc -c < /tmp/keepalive-artifacts/task-appendix.txt) bytes)"
- env:
- TASK_APPENDIX: ${{ steps.evaluate.outputs.task_appendix }}
+ echo "Task appendix ready ($(wc -c < /tmp/keepalive-artifacts/task-appendix.txt) bytes)"
- name: Upload task appendix artifact
if: steps.evaluate.outputs.action == 'run' || steps.evaluate.outputs.action == 'fix' || steps.evaluate.outputs.action == 'conflict'
- uses: actions/upload-artifact@v6
+ uses: actions/upload-artifact@v7
with:
name: keepalive-task-appendix-${{ steps.evaluate.outputs.pr_number }}
path: /tmp/keepalive-artifacts/task-appendix.txt
diff --git a/.github/workflows/reusable-codex-run.yml b/.github/workflows/reusable-codex-run.yml
index f87ee44..a9f15e8 100644
--- a/.github/workflows/reusable-codex-run.yml
+++ b/.github/workflows/reusable-codex-run.yml
@@ -443,7 +443,7 @@ jobs:
id: download_appendix
if: inputs.mode == 'keepalive' && inputs.pr_number != ''
continue-on-error: true
- uses: actions/download-artifact@v6
+ uses: actions/download-artifact@v7
with:
name: keepalive-task-appendix-${{ inputs.pr_number }}
path: /tmp/keepalive-artifacts
@@ -486,20 +486,20 @@ jobs:
fi
# For keepalive mode, prefer artifact file to avoid secret scanner blocking
- appendix_content=""
+ # Stream file contents directly to avoid loading large content into memory
if [ "$MODE" = "keepalive" ] && [ -f "/tmp/keepalive-artifacts/task-appendix.txt" ]; then
- echo "Reading task appendix from artifact file"
- appendix_content=$(cat /tmp/keepalive-artifacts/task-appendix.txt)
+ echo "Streaming task appendix from artifact file"
+ {
+ echo
+ echo "## Run context"
+ cat /tmp/keepalive-artifacts/task-appendix.txt
+ } >> "$output"
elif [ -n "$APPENDIX" ]; then
echo "Using task appendix from input parameter"
- appendix_content="$APPENDIX"
- fi
-
- if [ -n "$appendix_content" ]; then
{
echo
echo "## Run context"
- printf '%s\n' "$appendix_content"
+ printf '%s\n' "$APPENDIX"
} >> "$output"
fi
diff --git a/templates/consumer-repo/.github/workflows/agents-keepalive-loop.yml b/templates/consumer-repo/.github/workflows/agents-keepalive-loop.yml
index f4948cb..5df9b8e 100644
--- a/templates/consumer-repo/.github/workflows/agents-keepalive-loop.yml
+++ b/templates/consumer-repo/.github/workflows/agents-keepalive-loop.yml
@@ -311,9 +311,49 @@ jobs:
for (const [key, value] of Object.entries(output)) {
core.setOutput(key, value);
}
- // Task appendix needs special handling due to multiline content
+
+ // Task appendix: Write directly to file to avoid GitHub's secret scanner
+ // blocking job outputs (which happens with long/repetitive content).
+ // Writing here (before setOutput) ensures the content reaches the artifact
+ // even if the output gets censored.
+ const fs = require('fs');
+ const path = require('path');
+ const artifactsDir = '/tmp/keepalive-artifacts';
+ const appendixPath = path.join(artifactsDir, 'task-appendix.txt');
+
+ // Ensure artifacts directory exists
+ fs.mkdirSync(artifactsDir, { recursive: true });
+
+ // Write the full task appendix directly to the artifact file
+ if (result.taskAppendix && result.taskAppendix.length > 0) {
+ fs.writeFileSync(appendixPath, result.taskAppendix + '\n', { encoding: 'utf8' });
+ core.info(`Task appendix written directly to file (${result.taskAppendix.length} chars)`);
+ } else {
+ // Create an empty file if there is no appendix content
+ fs.closeSync(fs.openSync(appendixPath, 'w'));
+ core.info('Empty task appendix file created');
+ }
+
+ // Keep output for backward compatibility (may be censored, but that's OK now)
core.setOutput('task_appendix', result.taskAppendix || '');
+ - name: Verify task appendix artifact
+ if: steps.evaluate.outputs.action == 'run' || steps.evaluate.outputs.action == 'fix' || steps.evaluate.outputs.action == 'conflict'
+ run: |
+ if [ ! -f /tmp/keepalive-artifacts/task-appendix.txt ]; then
+ echo "ERROR: Task appendix file not created by evaluate step"
+ exit 1
+ fi
+ echo "Task appendix ready ($(wc -c < /tmp/keepalive-artifacts/task-appendix.txt) bytes)"
+
+ - name: Upload task appendix artifact
+ if: steps.evaluate.outputs.action == 'run' || steps.evaluate.outputs.action == 'fix' || steps.evaluate.outputs.action == 'conflict'
+ uses: actions/upload-artifact@v7
+ with:
+ name: keepalive-task-appendix-${{ steps.evaluate.outputs.pr_number }}
+ path: /tmp/keepalive-artifacts/task-appendix.txt
+ retention-days: 1
+
preflight:
name: Verify secrets available
needs: evaluate