# Auto-update last updated dates

> Use a GitHub Action to automatically update the last-updated frontmatter property when MDX files change.

You can use a GitHub Action to automatically update the [`last-updated` frontmatter property](/learn/docs/configuration/page-level-settings#last-updated) whenever MDX files are modified in a pull request. This keeps your documentation's "Last updated" timestamp accurate without manual updates.

## Set up the workflow

Add this GitHub Action workflow to your documentation repository.

When a pull request is opened or updated, the workflow detects which MDX files changed, updates or adds a `last-updated` field in their frontmatter with the current date, and commits the changes back to the PR branch.

<Note>
  The date format is "Month Day, Year" (e.g., "December 11, 2025"). You can customize this by modifying the `date` command in the workflow.
</Note>

```yml title=".github/workflows/update-last-updated.yml" maxLines=14
name: Update last updated date