Skip to content

Commit f2980a8

Browse files
committed
ci: Fix ENV vars capture
Signed-off-by: Chaitanya Tata <[email protected]>
1 parent 834d2ad commit f2980a8

File tree

1 file changed

+34
-15
lines changed

1 file changed

+34
-15
lines changed

.github/workflows/module-monitor.yml

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -130,20 +130,25 @@ jobs:
130130
break
131131
132132
# Output the table
133-
print("diff_output<<EOF", file=sys.stdout)
133+
diff_content = []
134134
if has_changes:
135-
print("## Firmware Blob Changes", file=sys.stdout)
136-
print("", file=sys.stdout)
137-
for row in table_rows:
138-
print(row, file=sys.stdout)
135+
diff_content.append("## Firmware Blob Changes")
136+
diff_content.append("")
137+
diff_content.extend(table_rows)
139138
else:
140-
print("## No Changes Detected", file=sys.stdout)
141-
print("", file=sys.stdout)
142-
print("All firmware blobs remain unchanged in this PR.", file=sys.stdout)
143-
print("", file=sys.stdout)
144-
print("### Current Firmware Blob Summary:", file=sys.stdout)
145-
for row in table_rows[2:]: # Skip header rows
146-
print(row, file=sys.stdout)
139+
diff_content.append("## No Changes Detected")
140+
diff_content.append("")
141+
diff_content.append("All firmware blobs remain unchanged in this PR.")
142+
diff_content.append("")
143+
diff_content.append("### Current Firmware Blob Summary:")
144+
diff_content.extend(table_rows[2:]) # Skip header rows
145+
146+
# Write to file for GitHub Actions output
147+
with open('diff_output.txt', 'w') as f:
148+
f.write('\n'.join(diff_content))
149+
150+
print("diff_output<<EOF", file=sys.stdout)
151+
print('\n'.join(diff_content), file=sys.stdout)
147152
print("EOF", file=sys.stdout)
148153
149154
# Also output current blob summary
@@ -156,10 +161,14 @@ jobs:
156161
info += f" - Description: {blob.get('description', 'No description')}\n"
157162
blob_info.append(info)
158163
164+
blob_content = ["## Current Firmware Blobs:"] + blob_info
165+
166+
# Write to file for GitHub Actions output
167+
with open('blob_summary.txt', 'w') as f:
168+
f.write('\n'.join(blob_content))
169+
159170
print("blob_summary<<EOF", file=sys.stdout)
160-
print("## Current Firmware Blobs:", file=sys.stdout)
161-
for info in blob_info:
162-
print(info, file=sys.stdout)
171+
print('\n'.join(blob_content), file=sys.stdout)
163172
print("EOF", file=sys.stdout)
164173
165174
except Exception as e:
@@ -171,6 +180,16 @@ jobs:
171180
print("EOF", file=sys.stdout)
172181
EOF
173182
183+
- name: Set output variables
184+
run: |
185+
echo "diff_output<<EOF" >> $GITHUB_OUTPUT
186+
cat diff_output.txt >> $GITHUB_OUTPUT
187+
echo "EOF" >> $GITHUB_OUTPUT
188+
189+
echo "blob_summary<<EOF" >> $GITHUB_OUTPUT
190+
cat blob_summary.txt >> $GITHUB_OUTPUT
191+
echo "EOF" >> $GITHUB_OUTPUT
192+
174193
- name: Create or update comment
175194
uses: actions/github-script@v7
176195
with:

0 commit comments

Comments
 (0)