-
Notifications
You must be signed in to change notification settings - Fork 8
49 lines (41 loc) · 1.68 KB
/
fetch.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
39
40
41
42
43
44
45
46
47
48
49
name: De paseo por el metaverso más foral
on:
push:
paths:
- '**.mjs'
- '**.yml'
schedule:
- cron: '*/5 * * * *'
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Trae el repositorio
uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 0
- name: Captura el estado de las salas
env:
TWITTER_CONSUMER_API_KEY: ${{ secrets.TWITTER_CONSUMER_API_KEY }}
TWITTER_CONSUMER_API_SECRET: ${{ secrets.TWITTER_CONSUMER_API_SECRET }}
TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }}
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
run: |-
CREDENTIALS=$(curl --silent \
'https://api.spatial.io/api/v1/rooms/noauth/6246b6964f7a930001a7636a' -X POST \
--data-raw '{"roomShareID":"4069560728893578203","noAuthUserID":""}' | jq --raw-output '.tempToken')
git config user.name "El portero del metaverso"
git config user.email "actions@users.noreply.github.com"
DATE=$(date -Iseconds)
curl --silent --header "Authorization: Bearer $CREDENTIALS" \
"https://api.spatial.io/api/v1/rooms/?queryType=batch&roomIDs=6246b6964f7a930001a7636a&roomIDs=6246b7064f7a930001a76375" \
| jq > "responses/$DATE.json"
node check.mjs "latest.json" "responses/$DATE.json"
ln -sf "responses/$DATE.json" latest.json
git add responses latest.json
git commit --message="Toma de datos del $DATE"
- name: Hace el «push»
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.token }}