-
Notifications
You must be signed in to change notification settings - Fork 2
38 lines (32 loc) · 886 Bytes
/
scrape.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Scrape OpenAI data
on:
push:
workflow_dispatch:
schedule:
- cron: '1 2 * * *'
permissions:
contents: write
jobs:
ai-scraper:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Scrape
run: |
export FILEPATH="openai/api/models.txt"
curl https://api.openai.com/v1/models -H "Authorization: Bearer ${{ secrets.OPENAI_API_KEY }}" | jq -r '.data | .[] | .id' | sort -n > ${FILEPATH}
- name: Commit and push
run: |-
git config user.name "Automated"
git config user.email "[email protected]"
git add -A
timestamp=$(date -u)
git commit -m "${timestamp}" || exit 0
git pull --rebase
git push