discoverweekly.dev
discoverweekly.dev copied to clipboard
Lower barrier of entry for submission
At the moment, submissions are only possible via a fork/PR/merge process, which is cumbersome.
Some ideas to automate submissions:
- GitHub issue, monitor comments with an Action
- Web UI
I most probably not gonna build a Web UI soon (too many side projects 😉). Of course not against a PR if anyone would jump in.
To the contrary, the "GitHub issue, monitor comments with an Action" sounds like an interesting option and learning.
Thanks for the idea and issue!
Yes, the web UI is probably the option that requires the most work, I'm not a fan either (plus having to deal with captcha, spam etc).
At the end of the day, having static Markdown files for submissions is good. The way I see an integration with comments:
- Have a pinned issue, for example named "Submissions"
- Comments to that issue trigger a GitHub Actions run that:
- Verifies the formatting and aborts if invalid
- Pulls information about the user from the GitHub API (can be edited by the user afterwards with a PR)
- Generates and commits the Markdown file (see "Validation")
Cases not covered:
- Editing the comment (doesn't edit the file)
- Editing the file (doesn't edit the comment)
Validation
Just like you approve submissions via PRs, you'd need a way to approve those as well. I see two ways to do that:
- Liking the comment (👍) triggers the workflow (approve beforehand)
- The workflow runs for all comments, but open a PR rather than landing on
main(approve afterwards)
Edit: There does not seem to be a way to detect reactions in comments to trigger Actions runs, so creating PRs might be the only option.
Prior Art
https://github.com/nwtgck/actions-comment-run - (way too much leeway there) https://github.com/peter-evans/create-or-update-comment - (feedback from the action)
Sounds super cool! I am not the best when it comes to such automation, it's a bit challenging and therefore interesting 😉. Being said, here too open to contributions.
I've got a basic proof of concept in franky47/actions-laboratory:
- The workflow listens for issue comments
- An example comment was posted
- The Actions run generated a Pull Request
- Which created a file with the contents of the comment
Todo:
- Lock workflow to a specific issue number
- Add validation to avoid spam
- Test comment edition with PR update
- Escape backticks to handle code blocks (not critical in this application though)
As a side-note, I'm definitely going to write about how this hack can make blog posts easier. 😀
Wow that's such a cool hack 🔥
This is seriously cool. It can also show the action progress/status using reactions on the original comment:

Hahaha c'que c'est bien!