11name : Module Monitor
22on :
3- pull_request_target :
3+ pull_request :
44 paths :
55 - ' zephyr/module.yml'
66
5454 git show $HEAD_REF:zephyr/module.yml > new_module.yml
5555
5656 # Parse YAML and generate comparison table
57+ echo "DEBUG: Starting Python script..." >&2
5758 python3 << 'EOF'
5859 import yaml
5960 import sys
8586 return "N/A"
8687
8788 try:
89+ print("DEBUG: Loading old_module.yml...", file=sys.stderr)
8890 # Load old and new module.yml
8991 with open('old_module.yml', 'r') as f:
9092 old_data = yaml.safe_load(f)
93+ print("DEBUG: Loading new_module.yml...", file=sys.stderr)
9194 with open('new_module.yml', 'r') as f:
9295 new_data = yaml.safe_load(f)
9396
@@ -144,9 +147,12 @@ jobs:
144147 diff_content.extend(table_rows[2:]) # Skip header rows
145148
146149 # Write to file for GitHub Actions output
150+ print(f"DEBUG: Writing {len(diff_content)} lines to diff_output.txt", file=sys.stderr)
147151 with open('diff_output.txt', 'w') as f:
148152 f.write('\n'.join(diff_content))
149153
154+ print(f"DEBUG: Successfully wrote diff_output.txt", file=sys.stderr)
155+
150156 print("diff_output<<EOF", file=sys.stdout)
151157 print('\n'.join(diff_content), file=sys.stdout)
152158 print("EOF", file=sys.stdout)
@@ -164,9 +170,12 @@ jobs:
164170 blob_content = ["## Current Firmware Blobs:"] + blob_info
165171
166172 # Write to file for GitHub Actions output
173+ print(f"DEBUG: Writing {len(blob_content)} lines to blob_summary.txt", file=sys.stderr)
167174 with open('blob_summary.txt', 'w') as f:
168175 f.write('\n'.join(blob_content))
169176
177+ print(f"DEBUG: Successfully wrote blob_summary.txt", file=sys.stderr)
178+
170179 print("blob_summary<<EOF", file=sys.stdout)
171180 print('\n'.join(blob_content), file=sys.stdout)
172181 print("EOF", file=sys.stdout)
@@ -178,17 +187,37 @@ jobs:
178187 print("blob_summary<<EOF", file=sys.stdout)
179188 print(f"Error parsing module.yml: {e}", file=sys.stdout)
180189 print("EOF", file=sys.stdout)
190+ print("DEBUG: Python script completed successfully", file=sys.stderr)
181191 EOF
182192
183193 - name : Set output variables
184194 run : |
185- echo "diff_output<<EOF" >> $GITHUB_OUTPUT
186- cat diff_output.txt >> $GITHUB_OUTPUT
187- echo "EOF" >> $GITHUB_OUTPUT
195+ echo "DEBUG: Checking if files exist..." >&2
196+ ls -la *.txt >&2 || echo "No .txt files found" >&2
197+
198+ if [ -f diff_output.txt ]; then
199+ echo "DEBUG: diff_output.txt exists, size: $(wc -c < diff_output.txt)" >&2
200+ echo "diff_output<<EOF" >> $GITHUB_OUTPUT
201+ cat diff_output.txt >> $GITHUB_OUTPUT
202+ echo "EOF" >> $GITHUB_OUTPUT
203+ else
204+ echo "DEBUG: diff_output.txt not found" >&2
205+ echo "diff_output<<EOF" >> $GITHUB_OUTPUT
206+ echo "No changes detected" >> $GITHUB_OUTPUT
207+ echo "EOF" >> $GITHUB_OUTPUT
208+ fi
188209
189- echo "blob_summary<<EOF" >> $GITHUB_OUTPUT
190- cat blob_summary.txt >> $GITHUB_OUTPUT
191- echo "EOF" >> $GITHUB_OUTPUT
210+ if [ -f blob_summary.txt ]; then
211+ echo "DEBUG: blob_summary.txt exists, size: $(wc -c < blob_summary.txt)" >&2
212+ echo "blob_summary<<EOF" >> $GITHUB_OUTPUT
213+ cat blob_summary.txt >> $GITHUB_OUTPUT
214+ echo "EOF" >> $GITHUB_OUTPUT
215+ else
216+ echo "DEBUG: blob_summary.txt not found" >&2
217+ echo "blob_summary<<EOF" >> $GITHUB_OUTPUT
218+ echo "No blob summary available" >> $GITHUB_OUTPUT
219+ echo "EOF" >> $GITHUB_OUTPUT
220+ fi
192221
193222 - name : Create or update comment
194223 uses : actions/github-script@v7
0 commit comments