Sponsorship auto-generate v0.1.40
This commit is contained in:
18
.github/workflows/update_sponsors.yml
vendored
18
.github/workflows/update_sponsors.yml
vendored
@@ -1,18 +0,0 @@
|
|||||||
name: Update Sponsors
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '25 11 * * *' # Set your preferred schedule (UTC)
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
update-readme:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout Repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Update Sponsors
|
|
||||||
run: |
|
|
||||||
GH_TOKEN=${{ secrets.GITHUB_TOKEN }}
|
|
||||||
gh run workflow_dispatch -R $GITHUB_REPOSITORY update_sponsors_table.yml
|
|
||||||
6
.github/workflows/update_sponsors_table.yml
vendored
6
.github/workflows/update_sponsors_table.yml
vendored
@@ -1,10 +1,8 @@
|
|||||||
name: Update Sponsors Table
|
name: Update Sponsors Table
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_run:
|
schedule:
|
||||||
workflows: ["Update Sponsors"]
|
- cron: '40 11 * * *' # Set your preferred schedule (UTC)
|
||||||
types:
|
|
||||||
- completed
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update-table:
|
update-table:
|
||||||
|
|||||||
@@ -72,10 +72,10 @@ def fetch_sponsors():
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Check if the sponsorship is current or past
|
# Check if the sponsorship is current or past
|
||||||
if privacy_level == "PUBLIC":
|
if created_at == sponsorship["createdAt"]:
|
||||||
current_sponsors.append(sponsor)
|
|
||||||
else:
|
|
||||||
past_sponsors.append(sponsor)
|
past_sponsors.append(sponsor)
|
||||||
|
else:
|
||||||
|
current_sponsors.append(sponsor)
|
||||||
|
|
||||||
print("Current Sponsors:")
|
print("Current Sponsors:")
|
||||||
print(current_sponsors)
|
print(current_sponsors)
|
||||||
@@ -85,6 +85,7 @@ def fetch_sponsors():
|
|||||||
return {"current_sponsors": current_sponsors, "past_sponsors": past_sponsors}
|
return {"current_sponsors": current_sponsors, "past_sponsors": past_sponsors}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def generate_sponsors_table(current_sponsors, past_sponsors):
|
def generate_sponsors_table(current_sponsors, past_sponsors):
|
||||||
current_table = "| Current Sponsors |\n|---|\n"
|
current_table = "| Current Sponsors |\n|---|\n"
|
||||||
for sponsor in current_sponsors:
|
for sponsor in current_sponsors:
|
||||||
|
|||||||
Reference in New Issue
Block a user