-
Notifications
You must be signed in to change notification settings - Fork 27
Description
As a maintainer, I want to enforce that any updates to FAQ pages also update their last_updated metadata so that readers know when the content was last reviewed or changed.
🧠 Context
Currently, contributors can edit FAQ pages without updating the last_updated field in the frontmatter. This makes it unclear whether the information is still current.
We want to ensure that any time a file in the faq section is modified, its last_updated value is also updated in the same commit.
Example FAQ page structure:
---
title: "What is the COMP 1405 Z Section?"
date: 2024-10-06T00:00:00Z
last_updated: 2024-10-06T00:00:00Z
draft: false
layout: faq-question
summary: "The Z section is an accelerated course that combines the content of COMP 1405 and COMP 1406 into a single term."
contributors:
- Aditya "Jacc" Padmakar
sources:
- name: Shopify Dev Degree
link: https://devdegree.ca/
- name: Override Requests
link: https://carleton.ca/registrar/registration/override-requests/
---We want a CI step to fail the build if a modified FAQ file does not include a change to the last_updated value.
🛠️ Implementation Plan
-
Write a Node.js script
-
Create a script called
check-last-updated.js(or similar) -
Use
git diff --name-only HEAD~1 HEADto get changed files -
Filter for files in the
faq/directory (or wherever FAQ content is stored) -
For each file:
- Use
git diffto check if thelast_updated:line has changed - If the file was changed but
last_updatedwas not, log an error
- Use
-
-
Add script to CI workflow
-
Create or update a GitHub Actions workflow at
.github/workflows/check-faq-updated.yml -
Add a job that:
- Checks out the repo
- Installs Node
- Runs the script
-
Fail the workflow if any violations are detected
-
-
Optional: Add friendly error message
- Instruct contributors to update the
last_updatedfield when modifying FAQ content
- Instruct contributors to update the
✅ Acceptance Criteria
-
A script exists (e.g.
check-last-updated.js) that:- Detects modified FAQ files
- Fails if
last_updated:is unchanged in a modified file
-
A GitHub Actions workflow runs the script on each PR
-
The CI fails with a clear message if any FAQ page is modified without updating
last_updated -
Only files in the
faq/directory are affected by this rule
Metadata
Metadata
Assignees
Labels
Type
Projects
Status