Skip to content

Commit

Permalink
feat: add coupon action workflow (#1)
Browse files Browse the repository at this point in the history
* Create coupon.yml

* Update coupon.yml

* chore: update coupon

* Update coupon.yml

* Update coupon.yml
  • Loading branch information
ridemountainpig committed Jan 8, 2024
1 parent 188b82b commit 11e38be
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 14 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/coupon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Uber Eats and Foodpanda coupon

on:
schedule:
- cron: "0 */24 * * *"
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Run coupon code
run: |
python coupon-script/ubereats-coupon.py
python coupon-script/foodpanda-coupon.py
- name: Generate coupon md
run: |
python coupon-script/readme.py
- name: Configure git
run: |
git config --global user.name "${{ vars.GITUSERNAME }}"
git config --global user.email "${{ vars.GITUSEREMAIL }}"
- name: Commit and push changes
run: |
if git diff-index --quiet HEAD --; then
echo "No changes detected."
else
git add .
git commit -m "chore: update coupon"
fi
continue-on-error: true

- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: main
github_token: ${{ secrets.GITHUB_TOKEN }}

5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Tasty Coupon


### Uber Eats 優惠碼丨外送優惠 2024 年 01 月 5
### Uber Eats 優惠碼丨外送優惠 2024 年 01 月 7
| 優惠內容 | 優惠代碼 | 優惠期間 | 適用範圍 |
| --- | --- | --- | --- |
|**訂閱會員優惠碼** : ```滿$100享4折最高可折$300可用2次```|```一月生鮮```|```~2024/1/22```|```生鮮雜貨首購```|
Expand Down Expand Up @@ -40,7 +40,7 @@
|**特選餐廳優惠** : ```午茉綠買一送一```|``````|```送完為止```|```再睡五分鐘```|
|**特選餐廳優惠** : ```滿$300折$45```|``````|```兌完為止```|```MisterDount```|

### foodpanda 優惠碼丨熊貓 外送優惠 2024 年 01 月 5
### foodpanda 優惠碼丨熊貓 外送優惠 2024 年 01 月 7
| 優惠內容 | 優惠代碼 | 優惠期間 | 適用範圍 |
| --- | --- | --- | --- |
|**訂閱會員優惠碼** : ```訂閱年費3折```|```PRO3```|```用完為止```|```非訂閱用戶```|
Expand Down Expand Up @@ -81,7 +81,6 @@
|**生鮮雜貨優惠碼** : ```大杯經典系列大杯特濃系列大杯極選系列買2送1```|``````|```週一到週四```|```全家便利商店```|
|**生鮮雜貨優惠碼** : ```大杯經典系列大杯特濃系列大杯極選系列買2送2```|``````|```週五到週日```|```全家便利商店```|
|**生鮮雜貨優惠碼** : ```滿$799享84折最高折抵$300每人限用1次```|```一袋一袋買```|```~2024/1/31```|```熊貓超市指定分店```|
|**生鮮雜貨優惠碼** : ```滿$649享75折最高折抵$300每人可用1次```|```一袋一袋煮```|```2024/1/6限定```|```熊貓超市指定分店```|
|**生鮮雜貨優惠碼** : ```滿$649享75折最高折抵$300每人可用1次```|```一袋一袋洗```|```2024/1/13限定```|```熊貓超市指定分店```|
|**生鮮雜貨優惠碼** : ```滿$649享75折最高折抵$300每人可用1次```|```一袋一袋拆```|```2024/1/20限定```|```熊貓超市指定分店```|
|**生鮮雜貨優惠碼** : ```滿$699享82折最高折抵$200每人限用1次```|```一袋一袋掃```|```~2024/2/1```|```生鮮雜貨指定店家```|
Expand Down
3 changes: 1 addition & 2 deletions asset/md/foodpanda-table.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

### foodpanda 優惠碼丨熊貓 外送優惠 2024 年 01 月 5
### foodpanda 優惠碼丨熊貓 外送優惠 2024 年 01 月 7
| 優惠內容 | 優惠代碼 | 優惠期間 | 適用範圍 |
| --- | --- | --- | --- |
|**訂閱會員優惠碼** : ```訂閱年費3折```|```PRO3```|```用完為止```|```非訂閱用戶```|
Expand Down Expand Up @@ -40,7 +40,6 @@
|**生鮮雜貨優惠碼** : ```大杯經典系列大杯特濃系列大杯極選系列買2送1```|``````|```週一到週四```|```全家便利商店```|
|**生鮮雜貨優惠碼** : ```大杯經典系列大杯特濃系列大杯極選系列買2送2```|``````|```週五到週日```|```全家便利商店```|
|**生鮮雜貨優惠碼** : ```滿$799享84折最高折抵$300每人限用1次```|```一袋一袋買```|```~2024/1/31```|```熊貓超市指定分店```|
|**生鮮雜貨優惠碼** : ```滿$649享75折最高折抵$300每人可用1次```|```一袋一袋煮```|```2024/1/6限定```|```熊貓超市指定分店```|
|**生鮮雜貨優惠碼** : ```滿$649享75折最高折抵$300每人可用1次```|```一袋一袋洗```|```2024/1/13限定```|```熊貓超市指定分店```|
|**生鮮雜貨優惠碼** : ```滿$649享75折最高折抵$300每人可用1次```|```一袋一袋拆```|```2024/1/20限定```|```熊貓超市指定分店```|
|**生鮮雜貨優惠碼** : ```滿$699享82折最高折抵$200每人限用1次```|```一袋一袋掃```|```~2024/2/1```|```生鮮雜貨指定店家```|
Expand Down
2 changes: 1 addition & 1 deletion asset/md/ubereats-table.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

### Uber Eats 優惠碼丨外送優惠 2024 年 01 月 5
### Uber Eats 優惠碼丨外送優惠 2024 年 01 月 7
| 優惠內容 | 優惠代碼 | 優惠期間 | 適用範圍 |
| --- | --- | --- | --- |
|**訂閱會員優惠碼** : ```滿$100享4折最高可折$300可用2次```|```一月生鮮```|```~2024/1/22```|```生鮮雜貨首購```|
Expand Down
8 changes: 1 addition & 7 deletions coupon-json/foodpanda-coupon.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"foodpanda 優惠碼丨熊貓 外送優惠 2024 年 01 月 5 日 ": {
"foodpanda 優惠碼丨熊貓 外送優惠 2024 年 01 月 7 日 ": {
"訂閱會員 優惠碼": [
{
"優惠內容": "訂閱 年費3折",
Expand Down Expand Up @@ -237,12 +237,6 @@
"優惠期間": "~ 2024/1/31",
"適用範圍": "熊貓超市 指定分店"
},
{
"優惠內容": "滿 $649 享 75 折最高折抵 $300每人可用 1 次",
"優惠代碼": "一袋一袋煮",
"優惠期間": "2024/1/6 限定",
"適用範圍": "熊貓超市 指定分店"
},
{
"優惠內容": "滿 $649 享 75 折最高折抵 $300每人可用 1 次",
"優惠代碼": "一袋一袋洗",
Expand Down
2 changes: 1 addition & 1 deletion coupon-json/ubereats-coupon.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Uber Eats 優惠碼丨外送優惠 2024 年 01 月 5 日 ": {
"Uber Eats 優惠碼丨外送優惠 2024 年 01 月 7 日 ": {
"訂閱會員 優惠碼": [
{
"優惠內容": "滿 $100 享 4 折最高可折 $300可用2次",
Expand Down

0 comments on commit 11e38be

Please sign in to comment.