-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (30 loc) · 1.04 KB
/
twitter-to-json.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
name: Update JSON with Twitter Data
on:
schedule:
- cron: '0 * * * *' # Run every hour
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/setup-node@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Install dependencies
run: npm ci
- name: Fetch Twitter data and update JSON
run: node ./scripts/update-json.js
env:
TWITTER_API_KEY: ${{ secrets.TWITTER_API_KEY }}
TWITTER_API_SECRET_KEY: ${{ secrets.TWITTER_API_SECRET_KEY }}
TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }}
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
- name: Commit and push changes
run: |
git config user.name "GitHub Actions Bot"
git config user.email "dragon@dragontheory.com"
git add .
git commit -m "Updated JSON with latest Twitter data" || echo "No changes to commit"
git push