Skip to content

Commit 4b1713d

Browse files
authored
Update action sponsors (#3451)
1 parent 0146eef commit 4b1713d

File tree

3 files changed

+24
-15
lines changed

3 files changed

+24
-15
lines changed

.github/workflows/fetchSponsorsData.yml renamed to .github/workflows/syncSponsorsData.yml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'Sync Sponsors and Contributors Data'
1+
name: 'Sync Sponsors Data'
22

33
on:
44
schedule:
@@ -7,11 +7,9 @@ on:
77
workflow_dispatch:
88

99
jobs:
10-
fetch-sponsors-data:
11-
name: Sync Sponsors and Contributors Data
10+
sync-sponsors-data:
11+
name: Sync Sponsors Data
1212
runs-on: ubuntu-latest
13-
permissions:
14-
contents: write
1513

1614
steps:
1715
- name: Checkout repository
@@ -26,8 +24,8 @@ jobs:
2624

2725
- run: pnpm i
2826

29-
- name: fetch-sponsors
30-
run: pnpm --filter fetch-sponsors run build
27+
- name: sync-sponsors
28+
run: pnpm sync:sponsors
3129
env:
3230
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3331

@@ -43,9 +41,7 @@ jobs:
4341
if: github.event_name != 'pull_request' && github.event_name != 'push'
4442
with:
4543
token: ${{ secrets.ORG_TAURI_BOT_PAT }}
46-
commit-message: 'chore(docs): Update Sponsors & Contributors Data'
47-
branch: ci/v2/update-data-docs
48-
path: tauri-docs
49-
title: Update Sponsors & Contributors Data
44+
commit-message: 'chore(docs): Update Sponsors Data'
45+
branch: ci/v2/update-sponsors
46+
title: Update Sponsors Data
5047
labels: 'bot'
51-

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
"dev:setup:tauri": "pnpm install -C packages/tauri/packages/api --ignore-workspace --no-frozen-lockfile",
1010
"dev:setup:plugins-workspace": "pnpm -C packages/plugins-workspace install",
1111
"dev:setup": "pnpm dev:setup:submodules && pnpm dev:setup:tauri && pnpm dev:setup:plugins-workspace && pnpm build:compatibility-table",
12+
"sync:sponsors": "pnpm --filter fetch-sponsors run build -- sponsors",
13+
"sync:contributors": "pnpm --filter fetch-sponsors run build -- contributors",
1214
"dev": "astro dev",
1315
"format": "prettier -w --cache --plugin prettier-plugin-astro .",
1416
"format:check": "prettier -c --cache --plugin prettier-plugin-astro .",

packages/fetch-sponsors/main.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,21 @@ import { fetchGitHubContributorsData } from './githubContributors.ts';
22
import { fetchGitHubSponsors } from './githubSponsors.ts';
33
import { fetchOpenCollectiveData } from './openCollective.ts';
44

5-
async function main() {
5+
export async function fetchContributors() {
6+
await fetchGitHubContributorsData();
7+
}
8+
9+
export async function fetchSponsors() {
610
await fetchOpenCollectiveData();
711
await fetchGitHubSponsors();
8-
await fetchGitHubContributorsData();
912
}
1013

11-
main();
14+
const target = process.argv[2];
15+
16+
if (target === 'contributors') {
17+
await fetchContributors();
18+
} else if (target === 'sponsors') {
19+
await fetchSponsors();
20+
} else {
21+
process.exit(1);
22+
}

0 commit comments

Comments
 (0)