Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readme update action #187

Merged

Conversation

max-programming
Copy link
Contributor

This PR adds a github action that runs a script to update examples in the README.md file based on the config.json and techs.json files

What has changed:

  • A techs.json file containing key-value pairs of all techs in README
  • A config.json file in each example
  • A Github action to run on every PR and look for these changes
  • A script that is called by the action to update the README

const config = JSON.parse(configData);

// If tech exists in mapping, use mapped name, otherwise use "Other"
const tech = techs[config.tech] || techs["other"];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you think it would make sense to default to the lowercase version of the tech if it doesnt existi n the mapping?

say someone adds "angular" as the tech, could just list out "angular" or a title cased version

another idea is to throw an error if the tech doesn't exist to force it to create a match. on top of that, you can add a validation on Pull Request to make sure the tech exists in the list, if it doesnt, the person making the PR needs to add it to the list

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this makes sense, added these features in the latest commit

@colbyfayock
Copy link
Collaborator

nice one, i assume its tested, hard for me to test i would assume. do you think this should run on PR or commits to main? wondering if trying to add it on PR would make it messy commit-wise

@max-programming
Copy link
Contributor Author

max-programming commented Oct 26, 2024

@colbyfayock I think it's better to comment on the PR as the everything will be merged along with the PR.
Plus we can track what was added and removed in the PR itself

Here's how the process looks like.
❌ It comments if no tech was added
✔️ it updates the readme when the tech is added
image

@max-programming
Copy link
Contributor Author

The error details section is now changed to "Missing tech(s)" and it'll include names of techs that aren't added in techs.json file

@colbyfayock
Copy link
Collaborator

awesome thanks @max-programming we'll see how it goes 🙌

@colbyfayock colbyfayock merged commit 73356b2 into cloudinary-community:main Oct 29, 2024
@max-programming
Copy link
Contributor Author

@colbyfayock One thing I forgot to mention is that you have to enable this option in the repository settings

Screenshot_20241029_204833_Edge.jpg

@colbyfayock
Copy link
Collaborator

already done! thanks

@bradgarropy
Copy link
Contributor

@max-programming This may not be working properly during the checkout portion.

Check out this workflow error.

@max-programming
Copy link
Contributor Author

@bradgarropy I'll fix this up and let you know ✌️

@max-programming
Copy link
Contributor Author

Fixes at #193

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants