-
Notifications
You must be signed in to change notification settings - Fork 6
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
Bot parsing entries from issue template #35
Comments
It looks like we could turn the issue body into an environment variable that we could then pass to e.g. a short python script creating the YAML file at the right place and with the right file name |
To make it clearer what we're working with, maybe open a sample issue at https://github.com/APECS-Earth-Observation/Polar-EO-Database/issues/new?assignees=octocat&labels=enhancement%2Ctriage&template=new_database_entry.yml&title=%5BNew%5D%3A+ and see how the resulting issue looks like? Edit: see #36 Looking at https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#keys, there's a unique |
Maybe that's our ticket? https://github.com/marketplace/actions/issue-body-parser |
I think if we search a bit more, we'll find someone who's already done it. This one https://github.com/peter-murray/issue-forms-body-parser by the same author looks a bit closer to what we want. I also found https://github.com/imjohnbo/extract-issue-template-fields and a few others that look close. Just need to find the right keyword to search for the right thing! |
I'm trying out with that one :) https://github.com/edumserrano/github-issue-forms-parser |
This one too look promising - https://github.com/stefanbuck/github-issue-parser. They even have a blog post https://stefanbuck.com/blog/codeless-contributions-with-github-issue-forms walking through a few examples. |
I'm playing with some examples here: https://github.com/APECS-Earth-Observation/Polar-EO-Database/tree/parsing-action/.github/workflows |
I'm not sure I see how to trigger them though |
I think you'll need to merge that GitHub Action to the main branch first (which isn't ideal during experimentation) for it to be triggered by new issues. Maybe test it on your personal fork? |
Hmm, still doesn't run... |
Check your settings on https://github.com/AdrienWehrle/Polar-EO-Database, you might need to enable GitHub Actions first (usually it's disabled by default on forks). Then, open an issue on your personal fork to see if it triggers a run. |
They are enabled but no issue possible on a fork..! |
Enable 'Issues' in settings first at https://github.com/AdrienWehrle/Polar-EO-Database/settings |
Oh nice thanks, never thought of having Issues enabled on a fork! Testing can start :) |
Excellent! So it looks like the https://github.com/stefanbuck/github-issue-parser one is working. Now we need to chain that parsed JSON output into something like https://github.com/peter-evans/create-pull-request. Maybe also setup a proper trigger (e.g. only run the action when a particular label like 'approved' is set) for security reasons. Great progress though, let's continue tomorrow! |
One more step 👍 AdrienWehrle#3 |
Remaining steps are:
I'm happy to work on this 😄 |
Nice, I recommend https://github.com/mikefarah/yq (which has a GitHub Action) to both convert JSON to YAML (e.g. |
Only saw your comment now! I used a simple python script to convert, rename and git add the right file, see AdrienWehrle@f5acb81 and associated workflow here. |
Haha you're too fast! Python works too, just thought |
I went for Python because we might want to do more stuff than just converting at some point? Don't know what exactly yet, but at least the option is there! |
Now that @weiji14 implemented the issue template for a new database entry, let's get a bot to create the associated YAML file in the database!
Useful resources
https://stackoverflow.com/questions/58597010/how-to-access-a-github-issue-comment-body-using-github-actions
The text was updated successfully, but these errors were encountered: