-
Notifications
You must be signed in to change notification settings - Fork 196
GitHub Action Check Folder Name
This GitHub Action automatically checks whether the folder name of a rule matches its uri (as defined in rule.md). If there's a mismatch, it renames the folder and updates the redirects field in rule.md to avoid broken links.
This workflow runs on pull requests that modify any rule.md file.
It gets triggered when:
-
A PR is opened
-
A PR is updated (synchronized)
-
Checks out the pull request code
Ensures it’s working with the latest PR branch and all changes -
Checks for modified
rule.mdfiles
Usesgit diffto determine whether anyrule.mdfile has changed compared toorigin/main. -
Runs folder renaming logic
If a modifiedrule.mdis found, it runs a shell script (.workflow/rename-folders.sh) that:-
Reads the
uri:field from each changedrule.md -
Compares it to the folder name
-
Renames the folder if there's a mismatch
-
Updates the
redirects:field inrule.mdto include the old folder name, so previous URLs still work
-
-
Commits and pushes the changes
If any folders were renamed, it automatically commits and pushes the changes back to the PR branch with the message:
"Rename folder to match URI"
- How to Create Rules
- How to Edit Rules
- How to Rename Rules
- How to Add and Edit Categories and Top Categories
- How to Rename Categories
- Creating your Fork (One time setup)
- Merging Your Fork
- Updating your fork
- Using Markdown
- Editing MDX Components (in GitHub)