Overview
Since my last post about the repository that I want to contribute to a lot of things have changed. Now I have a way better understanding of what I am working on, and how it suppose to look and work. I even created a PR with the initial version of changes to the repository.
Clarification
When I was writing my previous post I was having a wrong sense of what I had to work on and what it suppose to look like. After I asked for some clarification from the repo owner he updated his issue and everything became way more understandable.
Here are the steps that the repo owner listed about how this feature supposed to work:
We need an issue template, where people can submit a testimonial via a form
- Author of the testimonial would select the "testimonial" type and fill in the form
- The custom GitHub Action would be triggered by the Issue testimonial label and create the relevant file with JSON structure in the location of data//.json
- This would trigger another deployment, making the new testimonial available in the app
Implementation
I forked the repo and started to work on and I ended up creating/updating three files:
-
./github/ISSUE_TEMPLATE/testimonial.yml
which is the issue template that the user will use to put their testimonial and user name of the targeted user. -
./github/workflows/testimonial.yml
that does the following: The check-label job uses the match-label-action action to check if the opened issue has the testimonial label. If the issue has the testimonial label, the create-file job is run.
The create-file job first uses the checkout action to check out the repository. It then uses the github-issue-parser action to parse the issue body using the testimonial.yml template. The parsed data is saved in the $HOME/issue-parser-result.json file.
Next, the create-file job uses the create-file-action to create a new JSON file in the data directory, with the name and content generated from the parsed issue data. The file is then committed and pushed to the repository.
-
./github/workflows/deploy.yml
updated so it would be triggered when the previous workflow is completed
PR
When I was done and conducted many tests to make sure that my changes work as expected I created the PR and now I am waiting for a code review from a maintainer. Hope it going to end up well.
Top comments (0)