Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbfbe7d8

Browse files
committed
feat: add execution time tracking to documentation check
- Track start/end time of task execution- Calculate and format duration (minutes and seconds)- Display execution time in final PR comment with clock emoji- Helps users understand task performance
1 parent61af44b commitbfbe7d8

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

‎.github/workflows/documentation-check.yaml‎

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,16 +218,32 @@ jobs:
218218
env:
219219
TASK_NAME:${{ steps.create-task.outputs.TASK_NAME }}
220220
run:|
221+
START_TIME=$(date +%s)
222+
221223
echo "Waiting for task to complete..."
222224
./scripts/documentation-check.sh wait
223225
224226
echo "Getting task results..."
225227
TASK_OUTPUT=$(./scripts/documentation-check.sh summary)
226228
229+
END_TIME=$(date +%s)
230+
DURATION=$((END_TIME - START_TIME))
231+
232+
# Convert to minutes and seconds
233+
MINUTES=$((DURATION / 60))
234+
SECONDS=$((DURATION % 60))
235+
236+
if [ $MINUTES -gt 0 ]; then
237+
DURATION_STR="${MINUTES}m ${SECONDS}s"
238+
else
239+
DURATION_STR="${SECONDS}s"
240+
fi
241+
227242
# Save output to file for next step
228243
echo "${TASK_OUTPUT}" > /tmp/task_output.txt
244+
echo "${DURATION_STR}" > /tmp/task_duration.txt
229245
230-
echo "Task completed successfully"
246+
echo "Task completed successfully in ${DURATION_STR}"
231247
232248
-name:Update PR comment with results
233249
env:
@@ -239,13 +255,15 @@ jobs:
239255
RUN_ID:${{ github.run_id }}
240256
run:|
241257
TASK_OUTPUT=$(cat /tmp/task_output.txt)
258+
DURATION=$(cat /tmp/task_duration.txt)
242259
243260
COMMENT_BODY=$(cat <<EOF
244261
🤖 **Documentation Check Complete**
245262
246263
${TASK_OUTPUT}
247264
248265
---
266+
⏱️ Execution time: **${DURATION}**
249267
Task: https://dev.coder.com/tasks/${TASK_NAME}
250268
[View workflow run](https://github.com/${GITHUB_REPOSITORY}/actions/runs/${RUN_ID})
251269
EOF

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp