File tree Expand file tree Collapse file tree 1 file changed +60
-0
lines changed Expand file tree Collapse file tree 1 file changed +60
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Script to create PR body
4+ # Arguments: build_time total_time passed failed run_id comparison_section
5+
6+ BUILD_TIME=" $1 "
7+ TOTAL_TIME=" $2 "
8+ PASSED=" $3 "
9+ FAILED=" $4 "
10+ RUN_ID=" $5 "
11+ COMPARISON_SECTION=" $6 "
12+ REPO=" $7 "
13+
14+ # Convert seconds to minutes for better readability
15+ convert_time () {
16+ local seconds=" ${1% s} " # Remove 's' suffix if present
17+ local minutes=$(( seconds / 60 ))
18+ local remaining_seconds=$(( seconds % 60 ))
19+ echo " ${minutes} m ${remaining_seconds} s"
20+ }
21+
22+ BUILD_TIME_READABLE=$( convert_time " $BUILD_TIME " )
23+ TOTAL_TIME_READABLE=$( convert_time " $TOTAL_TIME " )
24+
25+ cat << EOF
26+ ## Summary
27+ This PR has been automatically created after successful completion of all CI stages.
28+
29+ ## Commit Message(s)
30+ \`\`\`
31+ EOF
32+
33+ cat /tmp/commit_message.txt
34+
35+ cat << EOF
36+ \`\`\`
37+
38+ ## Test Results
39+
40+ ### ✅ Build Stage
41+ - Status: Passed
42+ - Build Time: ${BUILD_TIME_READABLE}
43+ - Total Time: ${TOTAL_TIME_READABLE}
44+ - [View build logs](https://github.com/${REPO} /actions/runs/${RUN_ID} )
45+
46+ ### ✅ Boot Verification
47+ - Status: Passed
48+ - [View boot logs](https://github.com/${REPO} /actions/runs/${RUN_ID} )
49+
50+ ### ✅ Kernel Selftests
51+ - **Passed:** ${PASSED}
52+ - **Failed:** ${FAILED}
53+ - [View kselftest logs](https://github.com/${REPO} /actions/runs/${RUN_ID} )
54+
55+ ${COMPARISON_SECTION}
56+
57+ ---
58+ 🤖 This PR was automatically generated by GitHub Actions
59+ Run ID: ${RUN_ID}
60+ EOF
You can’t perform that action at this time.
0 commit comments