You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:00Zlast_updated: 2024-10-06T00:00:00Zdraft: falselayout: faq-questionsummary: "The Z section is an accelerated course that combines the content of COMP 1405 and COMP 1406 into a single term."contributors:
- Aditya "Jacc" Padmakarsources:
- name: Shopify Dev Degreelink: https://devdegree.ca/
- name: Override Requestslink: 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 HEAD to get changed files
Filter for files in the faq/ directory (or wherever FAQ content is stored)
For each file:
Use git diff to check if the last_updated: line has changed
If the file was changed but last_updated was not, log an error
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_updated field when modifying FAQ content
✅ 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
The text was updated successfully, but these errors were encountered:
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, itslast_updated
value is also updated in the same commit.Example FAQ page structure:
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 HEAD
to get changed filesFilter for files in the
faq/
directory (or wherever FAQ content is stored)For each file:
git diff
to check if thelast_updated:
line has changedlast_updated
was not, log an errorAdd script to CI workflow
Create or update a GitHub Actions workflow at
.github/workflows/check-faq-updated.yml
Add a job that:
Fail the workflow if any violations are detected
Optional: Add friendly error message
last_updated
field when modifying FAQ content✅ Acceptance Criteria
A script exists (e.g.
check-last-updated.js
) that:last_updated:
is unchanged in a modified fileA 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 ruleThe text was updated successfully, but these errors were encountered: