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

automate generate referrals #216

Merged
merged 23 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
4532040
chore: install node-html-parser
samhwang Mar 20, 2024
212c0e5
feat: add a script to scrape the list of ozbargain services
samhwang Mar 20, 2024
eed4b4c
feat: move build referral list script into src scripts
samhwang Mar 21, 2024
5a26b22
feat: add a function to create json data file
samhwang Mar 21, 2024
533662f
feat: clean up build referral list script
samhwang Mar 21, 2024
682b831
WIP: create github action to build ozbargain referrals
samhwang Mar 21, 2024
9142fdb
test:CI automate
samhwang Mar 22, 2024
529efea
update diff commands
samhwang Mar 22, 2024
7332848
test: use porcelain status
samhwang Mar 22, 2024
312475c
test: use production environment
samhwang Mar 22, 2024
fd8fb7a
test: link secret to env
samhwang Mar 22, 2024
92541ca
delettest: d generated file to triggerigger diff
samhwang Mar 22, 2024
f234e4c
test: use github token with gh cli
samhwang Mar 22, 2024
a466e39
chore: fix typo in file name
samhwang Mar 22, 2024
da4ffa1
print out outout of git status --porcelain
samhwang Mar 22, 2024
938da60
test: trigger diff part 2
samhwang Mar 22, 2024
1c4971b
feat: update branch name in making PR
samhwang Mar 22, 2024
ff0192c
feat: explicit add before making PR
samhwang Mar 22, 2024
83e5434
feat: remove the fill option and add explicit title and body
samhwang Mar 22, 2024
096b5ca
feat: fetch all git history
samhwang Mar 22, 2024
02462d0
test: force push
samhwang Mar 22, 2024
171e507
test: cleanup testing
samhwang Mar 22, 2024
122ac05
chore: regenerate ozbargain list
samhwang Mar 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/build-ozbargain-referrals-list.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build OzBargain referrals list

on:
workflow_dispatch:
schedule:
- cron: '0 0 1 * *'

jobs:
build-referrals-list:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up project
uses: ./.github/actions/setup-node-deps

- name: Build OzBargain referrals list
run: pnpm run build:referrals

- name: Setup Git Credentials
run: |
git config --global user.email "[email protected]"
git config --global user.name "Vietausit Admin (Github Actions)"

- name: Compare changes
run: |
git diff --quiet && git diff --staged --quiet || git commit -am 'Added license headers'

- name: Create new PR
run: |
gh pr create --title "chore: update OzBargain referrals list" --body "This PR updates the OzBargain referrals list" --base master
6 changes: 5 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
"formatWithErrors": false,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 160
"lineWidth": 160,
"ignore": [
"node_modules/**",
"./src/commands/referral/generated"
]
},
"javascript": {
"formatter": {
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"delete:command": "tsx src/scripts/delete-guild-commands.ts",
"delete:command-global": "tsx src/scripts/delete-global-commands.ts",
"start:only": "tsx watch --clear-screen=false ./src/index.ts",
"start": "pnpm prisma:migrate && pnpm prisma:gen && pnpm start:only"
"start": "pnpm prisma:migrate && pnpm prisma:gen && pnpm start:only",
"build:referrals": "tsx src/scripts/build-referral-list.ts"
},
"dependencies": {
"@axiomhq/winston": "^0.1.3",
Expand All @@ -51,6 +52,7 @@
"discord.js": "^14.14.1",
"dotenv": "^16.4.5",
"dotenv-expand": "^11.0.6",
"node-html-parser": "^6.1.12",
"oxide.ts": "^1.1.0",
"parse-duration": "^1.1.0",
"winston": "^3.12.0",
Expand Down
72 changes: 72 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/commands/referral/generated/ozbargain-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["13 seeds","1st energy","3commas","abra","active truth","admirals","adore beauty","aeg power tools","afterpay","ahm health insurance","airalo","airbike","airbnb - airbnb host","airtax","airvpn","airwallex","alpaka","alpha-h","alternative brewing","amaysim","amazingco","amber","amber electric","american express - business explorer card","american express - centurion personal charge card","american express - essential credit card","american express - explorer credit card","american express - platinum business card","american express - platinum card","american express - platinum card 275,000 points referee offer","american express - platinum edge credit card","american express - qantas business rewards card","american express - qantas discovery card","american express - qantas premium card","american express - qantas ultimate card","american express - velocity business card","american express - velocity escape card","american express - velocity platinum card","amino z","ampol","appliances online","arcline by racv","artscow - 1. new accounts","artscow - name stamp","asian pantry","asos","athena home loan","athletic greens","aura buy invest donate","aussie broadband","aussie house sitters","aussie pharma direct","australian unity","autoguru","awardwallet","backblaze","bake (formerly cake defi)","bamboo","banggood","bano","baopals","barbell foods","beach burrito","beam","beam wallet","beauty amora","beerhug","befrugal","belong - belong (mobile)","belong - belong broadband","better world books","bill hero","billy bubbles","binance - lite - usdt","binance - standard","binary lane","bird","bitcoin.com.au","bitpanda","bitrefill","bitstamp","bizcover","black type x","blackship","block earner","blossom","bluetti australia","blys","board game master","bokksu","bondi sands","boody bamboo clothing","boost your super","boozebud","border bank","bose australia","boxcryptor - boxcryptor unlimited","brand house direct","brazilian beauty","brookfarm","brooks running","bubble tea club","bulk nutrients","bunny.net","bupa","burgertory","butterfly network","buyandship","buyee japanese proxy service","bybit","byte australia","caltex / star mart - caltex fuelpay","canningvale","canva","cardly","caremax","cariuma","cashrewards","castlery","cell care","cellar one","cellardoor.co","chargrill charlie's","chatbooks","chatime","cheeky plant co.","chefgood","chefs on wheels","chipolo","chope - chope phuket","circles.life","classpass","code camp","coinjar","coinlist","coinspot","coinstash","cointracker","cointracking","cointree crypto exchange","comgateway","coolkidz australia","core powerfoods","coupert","covau energy","cowcow - $3.99 shoptell items","cowcow - $7.99 shoptell items","cowcow - custom glasses cloths","cowcow - custom handbag mirrors","cowcow - name stamp","creative labs","crypto.com","cryptospend","cubo ai","cult beauty","cupshe","currencyfair","daniel's donuts","dashlane","dataquest","decathlon australia","degoo","dental 99","dharma bums","di pacci coffee company","diamond energy","didi - didi","digital ocean","dinner twist","dinnerly","distrokid","doctors' health fund","dollar shave club - fbuy.me links","doordash","doordash - drivers/dashers only","douugh","dozen deals","dr. dough","dresden vision","drinkmate australia","drop","dropbox","duolingo","dymocks tutoring","dynadot","e-living furniture","e-pocket","easyequities","eatclub","ecoflow","econaps","elbaite","elite supplements","ellus & krue","energy locals","enphase","eskimo","esr gear","etax accountants","ethique","etoro","etsy - seller","ettitude","eubi australia","euca (proud products)","eva mattress","evee","everyday mobile from woolworths","everyday rewards","everyplate","evolve skateboards","exetel","expressvpn","eyebuydirect","ezlicence","fancraze","fantastic services","fantuan","fast cover travel insurance","fastmail","felix mobile","fever","fig & blooms","first table australia","fishme","fite","fitstop","fiverr","flexicar","flexiroam","flip","foody bag","framefox","freelancer","freeletics","french sweet","from japan","funding","furthr","future broadband","futuregolf","fuzenet internet","gami chicken & beer","garden of vegan","garden street gin club","gate.io","gdgt deals (engadget stacksocial)","gemini exchange","giffgaff","gimme","glamcorner","globird energy","gocardless","gocashback","gocatch","goldfields toys & games","good pair days","goodments","goodnessme","google workspace","gozney","groupon uk","grow my money (formerly super rewards)","guzman y gomez","gwent","gym and fitness","h&m","hay","hellofresh - $115-$125 off 1st box","heritage bank - $250 gift card with loan","hey bianca","heymax","hif","hillview farms","hipcamp","hnry","hodlnaut","homeseer","honey","honey insurance","hopper","hotel tonight","hp instant ink","hqhair","humble bundle - humble choice","hummingbird","hyper karting","icebreaker","ifttt","ig group","iherb.com","independent reserve","infinicloud","ing","inglewood coffee roasters","ingogo","instarem","institchu","integrately","interactive brokers australia","ipantry","ipaymy","iri shopper panel","italki","ivacy vpn","iwallpaper / macos game studio - iwallpaper","iwoot","jamie kay","jimmy brings","joonya eco wipes","juniper","just esim hong kong","just wines","kegland","kennards self storage - kennard's self storage","kent street cellars","ker-ching!","kickback australia","kiehl's","kitsch","kiwico","klarna","klook travel","knobby","koala","kogan","koh","koinly","koogle","krisp","kucoin","kx pilates","lalal.ai","launtel","leaptel","ledger","ledn","life cykel","lila beauty","lime","lingoda","linode","loaded lifting","loans.com.au","localcart","lookfantastic au","lookfantastic uk","looma's","loop earplugs","loyalty app","lskd","lucy & yak","lumin","lumo energy","luno","luxury escapes","lyka","lyka - first free box offer (for up to 5 referrals)","mac cosmetics","mad paws","madura tea","marley spoon","marriott","mashable","mask co","masterremit","mate communicate","matrix education","me bank","mealpal","mee audio","memberbuy","menulog - drivers/couriers","meta store","mexc global","minisforum","missguided australia","mixbook","mobimatter","mobvoi","modibodi","mofo smile","momentum energy","moneygram","monta","moo","moogoo","moomoo","mosh","mr. rebates","mubi","muscle diets","muscle nation","my foodie box","my muscle chef","mypaynow","myprotein, uk","myus.com","naked wines","nanoblock","naritas finance","natvia","navexa","nba top shot","nectr","need supplies","neowin","neuron mobility","news demon","nexo","nextpair","nielsen - homescan","nightowl convenience","no pong","noa home","nodeone","nomad, us","nomador","nonda","nordpass","nordvpn","normcore coffee","nourished life","novelship","numobile","nuphy studio","nuraphone","oakley","okcoin","okx","olive young","on oceania pty ltd","one month","one.com - warp","onedrive","onmarket bookbuilds","orange poland","orbitremit","origin energy - origin spike","ororo","otaku mode","otter ai","oura","outschool","ovo energy","oz hair & beauty","ozsale","ozsale mobile","panda remit","park on king","parkhound","patpat","pay.com.au","payo","paysend","pd car insurance","pearler","peloton","pennytel mobile","peoplecare","pepper leaf","perifit","pet chemist","pet circle","petzyo","phoenix health fund","photobookshop","picodi australia","pikmo","pingme","piping rock","planet express","plenti (previously ratesetter)","plico","pluralsight","pocketsmith","pod & parcel","pokémon go","pokitpal","polestar","polymail","popcar","popcultcha","powerpal","powershop","presearch","private internet access","probikekit","prohashing","proton mail","proud mary coffee","pure plant protein","pure-product","purevpn","qantas insurance - health insurance","qantas insurance - qantas wellbeing app","quad lock australia","quandoo","quantfury","quidco","quietgrowth","quiksilver","quizlet","qv skincare","qwertee","raiz","rakuten","rapha","readwise","rebtel","receiptjar","recollect","recyclesmart","red bull mobile","red energy","redteago","reflections holiday parks","refresh valet","remarkable","remitly","rentbetter","reship.com","revolut","revolution beauty","rewardsbunny","ride on! entertainment","ritual","roamless","roberts space industries","roboform","robot my life","rocketmiles","rollie nation","rollin' insurance (previously poncho insurance)","runescape","rush gold","ry (recreate yourself)","safestyle","safewill","san churro","sans drinks","saxo markets","sayso","scratch pet food","scribd","seats.aero","secret lab chairs","selfwealth","setapp","shady rays","share with oscar","sharesies","sharesight","shein","shenzen audio","shopback au","shping","sigmaos","simple. (mortgage broker)","simsdirect","singapore airlines - krispay / kris+","singx","skillshare","skrill","skrill - btc crypto","sleeping duck","smart traveller","smile","snap send solve","sniip","socialgood","society6","sodastream","solaredge","solbari","soulara","sovol3d","spaceship","sparrow and fox","speechify","spintel","sportitude","spriggy","square","square enix - final fantasy 14","stackry","stacksocial","stake","starlink","step one","sticker mule","stockspot","stonemen","stratia","student universe us","stylevana","sugarsync","sukin","sumo","sunglass hut","super obvious","superfeast","superhero","superloop","surfshark vpn","surfstitch","surveyz","swagbucks","sweat coin","swingvision","swoop broadband","swyftx crypto exchange","syfe","sync","t bar tea","taco bell","tamburlaine organic wines","tangerine telecom","tanggram","taxibox","teamm8","ted baker","tel-u","tempdrop","temple & webster","temu","tennis gear","tesla","teslafi","teslascope","tessie","the dinner ladies","the garden superstore","the iconic","the memo","the oodie","the pass loyalty app","the perfect underwear","the shade","the sippery","the whisky club","the whisky list","the wine collective","thefork","thinx","tidy me","tiger brokers","tile","tipple","tirtyl","topcashback au","topcashback uk","topcashback us","total tools","tour radar","tradingview","tripod coffee","true protein","truefire","trustedhousesitters","tyresales","tyroola","ubank","uber - drivers only","uber - riders only (uber pool)","uber carshare (formerly car next door)","uber eats","ubigi","ufodrive","ugg australia","ultra violette","unbrk","unique muscle","uniti wireless / uniti internet","unstoppable domains","unyoked","up bank","updoc","upstreet","urban company","urban plant growers","vauld","ventraip","vetsupply","viator","vic's meat","vincero watches","vinomofo","virgin active","virgin money","virgin voyages","virgo","vitable","vmp","vodafone","voip.ms","vpa australia","vultr","waggly club","waxit car care","we might be tiny","webull - deposit fund for fractional shares/vouchers reward","webull - transfer stock for trading vouchers reward","well home loans","wemoney","westfund health insurance","westpac - westpac choice account","wework","whitehat jr","who gives a crap","whoop","wiggle australia","wiggle uk","wilson parking","windscribe","wirex","wise","wolfit box","wonderbly","woolovers","workflowy","world of learning","world of warships","worldfirst","worldremit","wrapd (formerly her black book)","xe","xendpay","yak pay","yesstyle.com, hong kong","yolla calling app","yomojo","you need a budget","you plate it","youfoodz","youhodler","zavvi au","zavvi uk","zeller","zenmarket","zero co","zip pay","zipmex","zoho","zorali","zumba","zwift"]
Loading
Loading