Skip to content

.github/workflows/fetch-projects-by-topic.yml #15115

.github/workflows/fetch-projects-by-topic.yml

.github/workflows/fetch-projects-by-topic.yml #15115

on:
schedule:
- cron: '*/30 * * * *'
jobs:
fetch_projects:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install pnpm
uses: pnpm/[email protected]
id: pnpm-install
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-fetch-project-action
restore-keys: |
${{ runner.os }}-pnpm-store-fetch-project-action
- name: Install dependencies
run: |
pnpm install -g typescript ts-node
- name: Fetch first 1000 projects
run: |
ts-node --esm scripts/actions/fetch-projects-by-topic.ts bangkok-open-source 1000
- name: Add, commit and push to the repository
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Update ring.generated.json
branch: main
file_pattern: src/content/ring.generated.json