Skip to content

docs: unify documentation workflows with improved validation #17523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
fix: use platform-compatible date formatting in workflow
- Fix date formatting to be compatible with GitHub Actions runners (Linux)
- Use TZ=UTC instead of -u flag for better compatibility
- Remove unnecessary timestamp environment variable
- Ensure all date commands use the same format
  • Loading branch information
EdwardAngert committed Apr 24, 2025
commit ae660524cf043ac986ec5b49b2018d966d289bdc
10 changes: 4 additions & 6 deletions .github/workflows/docs-unified.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,6 @@ jobs:
# Post initial comment with preview links
- name: Post initial preview comment
if: inputs.post-comment == 'true' && inputs.generate-preview == 'true' && (inputs.pr-number != '' || github.event.pull_request)
env:
TIMESTAMP: ${{ steps.start-time.outputs.timestamp }}
uses: marocchino/sticky-pull-request-comment@v2.9.2
with:
header: docs-preview-comment
Expand All @@ -314,8 +312,8 @@ jobs:
- [Installation Guide](https://coder.com/docs/@${{ steps.context-info.outputs.sanitized_branch }}/install)
- [Quickstart](https://coder.com/docs/@${{ steps.context-info.outputs.sanitized_branch }}/tutorials/quickstart)

<sub>⏳ Validating documentation... (Started at $(date -u -d @$TIMESTAMP '+%Y-%m-%d %H:%M:%S UTC'))</sub>
<sub>⏱️ Status update: Waiting for validation results - last update: $(date -u '+%Y-%m-%d %H:%M:%S UTC')</sub>
<sub>⏳ Validating documentation... (Started at $(TZ=UTC date '+%Y-%m-%d %H:%M:%S UTC'))</sub>
<sub>⏱️ Status update: Waiting for validation results - last update: $(TZ=UTC date '+%Y-%m-%d %H:%M:%S UTC')</sub>

# Get changed files
- name: Get changed files
Expand Down Expand Up @@ -345,7 +343,7 @@ jobs:
- [Installation Guide](https://coder.com/docs/@${{ steps.context-info.outputs.sanitized_branch }}/install)
- [Quickstart](https://coder.com/docs/@${{ steps.context-info.outputs.sanitized_branch }}/tutorials/quickstart)

<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>
<sub>⏳ Found ${{ steps.changed-files.outputs.all_changed_files_count }} markdown files to validate. Starting validation at $(TZ=UTC date '+%Y-%m-%d %H:%M:%S UTC')...</sub>

# Run MegaLinter (documentation flavor)
- name: MegaLinter Documentation
Expand Down Expand Up @@ -673,7 +671,7 @@ jobs:
echo "- **Validation Success**: $SUCCESS% ($PASSING/$TOTAL checks passed)" >> $TEMP_FILE
echo "- **Processing Time**: $DURATION" >> $TEMP_FILE
echo "" >> $TEMP_FILE
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
echo "<sub>⏱️ Validation completed in $DURATION | Completed at $(TZ=UTC date '+%Y-%m-%d %H:%M:%S UTC') | [View Workflow Run]($WORKFLOW_RUN)</sub>" >> $TEMP_FILE

# Export content to GitHub output
echo "comment<<EOF" >> $GITHUB_OUTPUT
Expand Down