diff --git a/.github/workflows/fetchSponsorsData.yml b/.github/workflows/syncSponsorsData.yml similarity index 69% rename from .github/workflows/fetchSponsorsData.yml rename to .github/workflows/syncSponsorsData.yml index d6b1fd7a8..5d514d13b 100644 --- a/.github/workflows/fetchSponsorsData.yml +++ b/.github/workflows/syncSponsorsData.yml @@ -1,4 +1,4 @@ -name: 'Sync Sponsors and Contributors Data' +name: 'Sync Sponsors Data' on: schedule: @@ -7,11 +7,9 @@ on: workflow_dispatch: jobs: - fetch-sponsors-data: - name: Sync Sponsors and Contributors Data + sync-sponsors-data: + name: Sync Sponsors Data runs-on: ubuntu-latest - permissions: - contents: write steps: - name: Checkout repository @@ -26,8 +24,8 @@ jobs: - run: pnpm i - - name: fetch-sponsors - run: pnpm --filter fetch-sponsors run build + - name: sync-sponsors + run: pnpm sync:sponsors env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -43,9 +41,7 @@ jobs: if: github.event_name != 'pull_request' && github.event_name != 'push' with: token: ${{ secrets.ORG_TAURI_BOT_PAT }} - commit-message: 'chore(docs): Update Sponsors & Contributors Data' - branch: ci/v2/update-data-docs - path: tauri-docs - title: Update Sponsors & Contributors Data + commit-message: 'chore(docs): Update Sponsors Data' + branch: ci/v2/update-sponsors + title: Update Sponsors Data labels: 'bot' - \ No newline at end of file diff --git a/package.json b/package.json index 37672f425..fa5f5ce3c 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,8 @@ "dev:setup:tauri": "pnpm install -C packages/tauri/packages/api --ignore-workspace --no-frozen-lockfile", "dev:setup:plugins-workspace": "pnpm -C packages/plugins-workspace install", "dev:setup": "pnpm dev:setup:submodules && pnpm dev:setup:tauri && pnpm dev:setup:plugins-workspace && pnpm build:compatibility-table", + "sync:sponsors": "pnpm --filter fetch-sponsors run build -- sponsors", + "sync:contributors": "pnpm --filter fetch-sponsors run build -- contributors", "dev": "astro dev", "format": "prettier -w --cache --plugin prettier-plugin-astro .", "format:check": "prettier -c --cache --plugin prettier-plugin-astro .", diff --git a/packages/fetch-sponsors/main.ts b/packages/fetch-sponsors/main.ts index 55587f362..62b1ae362 100644 --- a/packages/fetch-sponsors/main.ts +++ b/packages/fetch-sponsors/main.ts @@ -2,10 +2,21 @@ import { fetchGitHubContributorsData } from './githubContributors.ts'; import { fetchGitHubSponsors } from './githubSponsors.ts'; import { fetchOpenCollectiveData } from './openCollective.ts'; -async function main() { - await fetchOpenCollectiveData(); - await fetchGitHubSponsors(); +export async function fetchContributors() { await fetchGitHubContributorsData(); } -main(); +export async function fetchSponsors() { + await fetchOpenCollectiveData(); + await fetchGitHubSponsors(); +} + +const target = process.argv[2]; + +if (target === 'contributors') { + await fetchContributors(); +} else if (target === 'sponsors') { + await fetchSponsors(); +} else { + process.exit(1); +}