-
Notifications
You must be signed in to change notification settings - Fork 0
23 lines (22 loc) · 986 Bytes
/
fetch.yml
File metadata and controls
23 lines (22 loc) · 986 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
name: Fetch from source
on:
schedule:
- cron: 0 0 * * 2,5
workflow_dispatch:
jobs:
Get-Source:
env:
FETCH_URL: 'https://youtube.fandom.com/api.php?action=query&format=json&origin=*&prop=revisions&titles=MediaWiki%3ACommon.css&formatversion=2&rvprop=content'
name: Fetch and commit source
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: set -euo pipefail
- run: echo '[INFO] Setting Git up...'
- run: git config --global user.name 'Actions'; git config --global user.email 'actions@github.com'
- run: echo "[INFO] $GITHUB_WORKSPACE"
- run: cd "$GITHUB_WORKSPACE"
- run: curl -fsSL '${{env.FETCH_URL}}' | jq -r '.query.pages[0].revisions[0].content' > Common.css
- run: git add Common.css
- run: git commit -m 'Fetch latest revision from URL' && git push -u origin main || echo '[INFO] Source is the same as repository. Skipping push...'
- run: echo '[EXIT] Job done!'; exit 0