Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/scripts/create-pr-body.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/bash

# Script to create PR body
# Arguments: build_time total_time passed failed run_id comparison_section

BUILD_TIME="$1"
TOTAL_TIME="$2"
PASSED="$3"
FAILED="$4"
RUN_ID="$5"
COMPARISON_SECTION="$6"
REPO="$7"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor, but just to be sure, I would check if nb of arguments is as expected.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

either number or args OR qualify each.

# Convert seconds to minutes for better readability
convert_time() {
Copy link
Collaborator

@PlaidCat PlaidCat Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally there are not issues here but we should validate the BUILD_TIME and TOTAL_TIME here or at script input validation.

Mostly concerned about accidental drift.

local seconds="${1%s}" # Remove 's' suffix if present
local minutes=$((seconds / 60))
local remaining_seconds=$((seconds % 60))
echo "${minutes}m ${remaining_seconds}s"
}

BUILD_TIME_READABLE=$(convert_time "$BUILD_TIME")
TOTAL_TIME_READABLE=$(convert_time "$TOTAL_TIME")

cat << EOF
## Summary
This PR has been automatically created after successful completion of all CI stages.

## Commit Message(s)
\`\`\`
EOF

cat /tmp/commit_message.txt
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is created outside of this script, can you add a check and fail before this section ... just in case.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally this is hardcoded in two separate files we should probably make this an input parameter


cat << EOF
\`\`\`

## Test Results

### ✅ Build Stage
- Status: Passed
- Build Time: ${BUILD_TIME_READABLE}
- Total Time: ${TOTAL_TIME_READABLE}
- [View build logs](https://github.com/${REPO}/actions/runs/${RUN_ID})

### ✅ Boot Verification
- Status: Passed
- [View boot logs](https://github.com/${REPO}/actions/runs/${RUN_ID})

### ✅ Kernel Selftests
- **Passed:** ${PASSED}
- **Failed:** ${FAILED}
- [View kselftest logs](https://github.com/${REPO}/actions/runs/${RUN_ID})

${COMPARISON_SECTION}

---
🤖 This PR was automatically generated by GitHub Actions
Run ID: ${RUN_ID}
EOF
Loading