Skip to content

Commit 021f8ad

Browse files
committed
ci: Fix table format and diff
Signed-off-by: Chaitanya Tata <[email protected]>
1 parent 00983bc commit 021f8ad

File tree

1 file changed

+29
-6
lines changed

1 file changed

+29
-6
lines changed

.github/workflows/module-monitor.yml

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
- name: Fetch PR head
2424
run: |
25-
git fetch origin pull/${{ github.event.pull_request.number }}/head:pr-head
25+
git fetch origin pull/${{ github.event.pull_request_target.number }}/head:pr-head
2626
2727
- name: Setup sdk-nrfxlib repository
2828
run: |
@@ -55,8 +55,15 @@ jobs:
5555
git log --oneline -5 >&2
5656
5757
# Get old and new module.yml content
58+
echo "DEBUG: Getting old module.yml from $BASE_REF" >&2
5859
git show $BASE_REF:zephyr/module.yml > old_module.yml
59-
git show $HEAD_REF:zephyr/module.yml > new_module.yml
60+
echo "DEBUG: Getting new module.yml from pr-head" >&2
61+
git show pr-head:zephyr/module.yml > new_module.yml
62+
63+
echo "DEBUG: Old module.yml content:" >&2
64+
head -5 old_module.yml >&2
65+
echo "DEBUG: New module.yml content:" >&2
66+
head -5 new_module.yml >&2
6067
6168
# Parse YAML and generate comparison table
6269
echo "DEBUG: Starting Python script..." >&2
@@ -218,9 +225,9 @@ jobs:
218225
old_commit_status = get_commit_status(old_commit_hash)
219226
new_commit_status = get_commit_status(new_commit_hash)
220227
221-
# Format commit display
222-
old_commit_display = old_commit_status['display']
223-
new_commit_display = new_commit_status['display']
228+
# Format commit display - simplify for better table formatting
229+
old_commit_display = old_commit_hash[:7] if old_commit_hash != "Unknown" else "Unknown"
230+
new_commit_display = new_commit_hash[:7] if new_commit_hash != "Unknown" else "Unknown"
224231
225232
diff_link = generate_diff_link(old_blob.get('url', ''), new_blob.get('url', ''))
226233
@@ -252,7 +259,23 @@ jobs:
252259
diff_content.append("All firmware blobs remain unchanged in this PR.")
253260
diff_content.append("")
254261
diff_content.append("### Current Firmware Blob Summary:")
255-
diff_content.extend(table_rows[2:]) # Skip header rows
262+
# Create a simplified summary table without the comparison columns
263+
summary_rows = []
264+
summary_rows.append("| Variant | Version | Commit |")
265+
summary_rows.append("|---------|---------|--------|")
266+
267+
for path in sorted(all_paths):
268+
new_blob = new_blobs.get(path, {})
269+
version = new_blob.get('version', 'N/A')
270+
commit_hash = extract_commit_from_url(new_blob.get('url', ''))
271+
commit_display = commit_hash[:7] if commit_hash != "Unknown" else "Unknown"
272+
273+
# Extract variant name from path
274+
variant = path.split('/')[-2] if '/' in path else path
275+
276+
summary_rows.append(f"| {variant} | {version} | {commit_display} |")
277+
278+
diff_content.extend(summary_rows)
256279
257280
# Write to file for GitHub Actions output
258281
print(f"DEBUG: Writing {len(diff_content)} lines to diff_output.txt", file=sys.stderr)

0 commit comments

Comments
 (0)