SSWConsulting / SSW.Rules

Generator for ssw.com.au/rules
https://www.ssw.com.au/rules
MIT License
11 stars 12 forks source link

๐Ÿงช GitHub Action - Ensure the folder is exactly the same as the Rules URI #1322

Closed JackDevAU closed 1 month ago

JackDevAU commented 2 months ago

CC @adamcogan @Aibono1225 @drwharris @bradystroud

Hi Team,

Description

When someone creates a PR that updates a rules uri and doesn't update the folder name, NetlifyCMS editor doesn't allow the user to edit the rule. We should fix this before it goes live.

### Tasks
- [x] Run a the script to fix all rules with this issue
- [x] Add a new GitHub Action that validates the folder name vs rules uri
- [x] Make a Wiki about how to construct the uri and foldername and how they need to match
Aibono1225 commented 1 month ago

Update:

Add a new GitHub Action that validates the folder name vs rules uri

Created a PR for running the auto fix: https://github.com/SSWConsulting/SSW.Rules.Content/pull/8540 ๐Ÿ™‚

Make a Wiki about how to construct the uri and foldername and how they need to match

There's already a wiki that mentions updating folder name when rename a rule: https://github.com/SSWConsulting/SSW.Rules.Content/wiki/How-to-Rename-Rules

Aibono1225 commented 1 month ago

Done - Now we have a github action running on Rules.Content that will check and auto-fix folder names. ๐Ÿ™‚

See action log: https://github.com/SSWConsulting/SSW.Rules.Content/actions/workflows/check-folder-name.yml

I tested it with a rule and the action automatically renamed the folder, and put the old folder name in the redirects ๐Ÿ’ช Image Figure: https://github.com/SSWConsulting/SSW.Rules.Content/pull/8543/commits/3474d97c331b42a2a85f9e2e395dddfd720287b9