Skip to content

Conversation

@flanakin
Copy link
Collaborator

🛠️ Description

Add a GitHub Action workflow that automatically updates the ms.date field in docs-mslearn markdown files when they are modified in a pull request. This ensures documentation dates stay current without manual intervention.

Changes include:

  • GitHub Action (.github/workflows/update-mslearn-dates.yml): Triggers on PRs that modify docs-mslearn/**/*.md files, updates the ms.date frontmatter to the current date, and commits the change back to the PR branch
  • Unit test (Action.UpdateMsLearnDates.Tests.ps1): Validates the GitHub Action workflow structure, triggers, permissions, and security considerations
  • Lint test (MsLearnDocs.Tests.ps1): Validates all docs-mslearn files have proper ms.date frontmatter in MM/DD/YYYY format
  • Test runner update: Added -Actions parameter to Test-PowerShell.ps1 for running GitHub Action tests (pattern: Action.*.Tests.ps1)

📋 Checklist

🔬 How did you test this change?

  • 🤏 Lint tests
  • 🤞 PS -WhatIf / az validate
  • 👍 Manually deployed + verified
  • 💪 Unit tests
  • 🙌 Integration tests

🙋‍♀️ Do any of the following that apply?

  • 🚨 This is a breaking change.
  • 🤏 The change is less than 20 lines of code.

📑 Did you update docs/changelog.md?

  • ✅ Updated changelog (required for dev PRs)
  • ➡️ Will add log in a future PR (feature branch PRs only)
  • ❎ Log not needed (small/internal change)

📖 Did you update documentation?

  • ✅ Public docs in docs (required for dev)
  • ✅ Public docs in docs-mslearn (required for dev)
  • ✅ Internal dev docs in docs-wiki (required for dev)
  • ✅ Internal dev docs in src (required for dev)
  • ➡️ Will add docs in a future PR (feature branch PRs only)
  • ❎ Docs not needed (small/internal change)

Add GitHub Action workflow that automatically updates the ms.date field
in docs-mslearn markdown files when they are modified in a pull request.
This ensures documentation dates stay current without manual intervention.

Also adds:
- Pester unit test to validate the GitHub Action workflow
- Pester lint test to validate ms.date format in all docs-mslearn files
- New -Actions parameter to Test-PowerShell.ps1 for running Action tests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 11, 2026 01:00
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Review 👀 PR that is ready to be reviewed label Feb 11, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces automation to keep Microsoft Learn documentation dates current by automatically updating the ms.date field in docs-mslearn markdown files when they are modified in a pull request. This reduces manual maintenance burden and ensures documentation metadata stays accurate.

Changes:

  • Adds a GitHub Action workflow that triggers on docs-mslearn markdown file changes, updates ms.date to the current date, and commits the change back to the PR branch
  • Implements comprehensive unit tests for the GitHub Action workflow structure and security
  • Adds lint tests to validate ms.date format compliance across all docs-mslearn files
  • Extends the test runner to support GitHub Action tests with a new -Actions parameter

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/update-mslearn-dates.yml New workflow that auto-updates ms.date fields in changed docs-mslearn markdown files
src/powershell/Tests/Unit/Action.UpdateMsLearnDates.Tests.ps1 Unit tests validating workflow structure, triggers, permissions, and security
src/powershell/Tests/Lint/MsLearnDocs.Tests.ps1 Lint tests ensuring ms.date format compliance (MM/DD/YYYY) across all docs-mslearn files
src/scripts/Test-PowerShell.ps1 Added -Actions parameter to run GitHub Action tests (Action.*.Tests.ps1 pattern)

@@ -0,0 +1,69 @@
name: Update ms.date in docs-mslearn
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

According to the FinOps toolkit coding guidelines, every change must have a changelog entry in docs-mslearn/toolkit/changelog.md with no exceptions for bug fixes, features, or improvements. This PR adds a new GitHub Action feature that automatically updates ms.date fields in docs-mslearn files, which is a customer-facing change that should be documented.

The changelog entry should be added under the next release version. Since package.json shows version 13.0.0, the changelog entry should be documented under the "PowerShell module v14" or similar appropriate section (or create a new unreleased section if one doesn't exist).

The changelog entry should briefly describe this new automation feature and its benefit to contributors.

Copilot generated this review using guidance from repository custom instructions.
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add docs-mslearn/**/*.md
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

The git add command uses a wildcard pattern that could stage unintended files. If there are other uncommitted changes in docs-mslearn markdown files (from previous steps or manual changes), they will be included in the commit.

Consider using git add with the specific files that were modified by this workflow. Since the sed commands only modify the files in the changed-files list, you could iterate over those files or use 'git add -u docs-mslearn/' to only add tracked files that were modified, which is safer than the wildcard pattern.

Suggested change
git add docs-mslearn/**/*.md
git add -u docs-mslearn/

Copilot uses AI. Check for mistakes.
@flanakin flanakin added this to the v14 milestone Feb 11, 2026
@flanakin flanakin changed the title feat: Auto-update ms.date in docs-mslearn on PR changes Auto-update ms.date in docs-mslearn on PR changes Feb 11, 2026
@flanakin flanakin added Skill: DevOps GitHub setup and automation Skill: Documentation Documentation updates Tool: FinOps guide Implementing FinOps guide and removed Skill: Documentation Documentation updates labels Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs: Review 👀 PR that is ready to be reviewed Skill: DevOps GitHub setup and automation Tool: FinOps guide Implementing FinOps guide

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants