Skip to content

Commit 6eb9c32

Browse files
committed
feat: enhance PR comments with timestamps and progress updates
- Add timestamps to initial, in-progress, and completion comments - Add a comment update after file detection to show progress - Improve user experience with better status messaging - Allow tracking of workflow progress through multiple stages
1 parent 6b714ec commit 6eb9c32

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

.github/workflows/docs-unified.yaml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,8 @@ jobs:
296296
# Post initial comment with preview links
297297
- name: Post initial preview comment
298298
if: inputs.post-comment == 'true' && inputs.generate-preview == 'true' && (inputs.pr-number != '' || github.event.pull_request)
299+
env:
300+
TIMESTAMP: ${{ steps.start-time.outputs.timestamp }}
299301
uses: marocchino/sticky-pull-request-comment@v2.9.2
300302
with:
301303
header: docs-preview-comment
@@ -312,7 +314,8 @@ jobs:
312314
- [Installation Guide](https://coder.com/docs/@${{ steps.context-info.outputs.sanitized_branch }}/install)
313315
- [Quickstart](https://coder.com/docs/@${{ steps.context-info.outputs.sanitized_branch }}/tutorials/quickstart)
314316
315-
<sub>⏳ Validating documentation...</sub>
317+
<sub>⏳ Validating documentation... (Started at $(date -u -d @$TIMESTAMP '+%Y-%m-%d %H:%M:%S UTC'))</sub>
318+
<sub>⏱️ Status update: Waiting for validation results - last update: $(date -u '+%Y-%m-%d %H:%M:%S UTC')</sub>
316319
317320
# Get changed files
318321
- name: Get changed files
@@ -323,6 +326,27 @@ jobs:
323326
docs/**/*.md
324327
**/*.md
325328
329+
# Update PR comment to show we're starting validation
330+
- name: Update PR comment with in-progress status
331+
if: inputs.post-comment == 'true' && (inputs.pr-number != '' || github.event.pull_request) && steps.changed-files.outputs.all_changed_files != ''
332+
uses: marocchino/sticky-pull-request-comment@v2.9.2
333+
with:
334+
header: docs-preview-comment
335+
number: ${{ inputs.pr-number || github.event.pull_request.number }}
336+
message: |
337+
# 📚 Documentation Preview ⏳
338+
339+
## 🖥️ [View Documentation Preview](https://coder.com/docs/@${{ steps.context-info.outputs.sanitized_branch }})
340+
341+
> ℹ️ **Validation in progress**: Preview links are available now! This comment will update with validation results when complete.
342+
343+
### Quick Links
344+
- [Main Docs](https://coder.com/docs/@${{ steps.context-info.outputs.sanitized_branch }})
345+
- [Installation Guide](https://coder.com/docs/@${{ steps.context-info.outputs.sanitized_branch }}/install)
346+
- [Quickstart](https://coder.com/docs/@${{ steps.context-info.outputs.sanitized_branch }}/tutorials/quickstart)
347+
348+
<sub>⏳ Found ${{ steps.changed-files.outputs.all_changed_files_count }} markdown files to validate. Starting validation at $(date -u '+%Y-%m-%d %H:%M:%S UTC')...</sub>
349+
326350
# Run MegaLinter (documentation flavor)
327351
- name: MegaLinter Documentation
328352
id: megalinter
@@ -649,7 +673,7 @@ jobs:
649673
echo "- **Validation Success**: $SUCCESS% ($PASSING/$TOTAL checks passed)" >> $TEMP_FILE
650674
echo "- **Processing Time**: $DURATION" >> $TEMP_FILE
651675
echo "" >> $TEMP_FILE
652-
echo "<sub>⏱️ Validation completed in $DURATION | [View Workflow Run]($WORKFLOW_RUN)</sub>" >> $TEMP_FILE
676+
echo "<sub>⏱️ Validation completed in $DURATION | Completed at $(date -u '+%Y-%m-%d %H:%M:%S UTC') | [View Workflow Run]($WORKFLOW_RUN)</sub>" >> $TEMP_FILE
653677
654678
# Export content to GitHub output
655679
echo "comment<<EOF" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy