github action hackathon is hackathon created by dev.to i won as a runner up here as spiritbro1
So background of the story is, i recently participated in dev.to hackathon called web monetization hackathon and i didn't win so 😢, but thank God dev.to give us another exciting hackathon that i recently learn also by making a covid telegram notification using github action you can check that out here
and most importantly is dev.to generous enough to gave me some credit to spend on dev.to shop Thank You Dev.to Team!! 😃 but the problem is i dont know which item i want to get from dev.to shop so why dont we make a github action that can get us some random item from dev.to shop. So let's begin.
So since dev.to doesnt have api to get the item and the price tag i need to scrape the dev.to shop and save it to csv i use csv coz it is much faster than setting up a whole new database you can take a look the code here:
last scraped in 17-9-2020
List of item scraped from devto shop
so what this does is, it scrape all item in dev.to shop and the price tag and put it to the csv in github repo there, so i create a python app to scrape all the item in dev.to and after that we get the raw csv from that python app then we create a github action that can randomly generate markdown with the item that randomly generated from dev.to shop for us, this github action will create a new file called DEVTOSHOP.md so it is basically can work with any repo if you just want to play with it. And doesn't disrupt an already created README.md.
create a repo
create a yaml file example here
let it run until finished like this
- after that you get a new branch called "devto-shop-random-generator" compare that branch and pull request
click "create pull request"
then click "merge pull request"
then click "confirm merge"
you will get a new markdown file called "DEVTOSHOP.md" click that
and then VOILA!! you will get your random item like this that you can buy based on your budget
take a note that this budget is not included with shipping payment coz it will vary based on your country
runner up dev.to hackathon https://dev.to/devteam/github-actions-hackathon-winners-announced-38o2
RANDOM DEV.TO SHOP ITEM GENERATOR
this action get you a random item that you can buy on a budget from dev.to shop
You can see the explanation here
budgetyour budget in us dollar
personal_tokento create a branch and pull request
github_repoyour repo name
# This is a basic workflow to help you get started with Actions name: Get Random Item from dev.to # Controls when the action will run. Triggers the workflow on push or pull request # events but only for the master branch on push branches: [ master ] # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: # This workflow contains a single job called "build" build: # The type of runner that the job will run on runs-on: ubuntu-latest #…
Example repo that use this github action