-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (54 loc) · 2.01 KB
/
Copy pathdev-update.yml
File metadata and controls
62 lines (54 loc) · 2.01 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
# Kept development helper: runs the updater from a feature branch with a
# mandatory TICKERS allowlist, captures its log and commits api/proshares/**.
# For a full refresh on main, use the shipped update-data.yml workflow instead.
name: Dev data refresh
on:
push:
branches-ignore:
- main
paths:
- 'dev-run/request.txt'
permissions:
contents: write
concurrency:
group: dev-data-refresh
cancel-in-progress: false
jobs:
refresh:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Setup bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile || bun install
- name: Run updater
run: |
set -a
while IFS= read -r line; do
case "$line" in ''|'#'*) continue;; esac
export "$line"
done < dev-run/request.txt
set +a
# Never start an unbounded dev-run job by accident. The user will run
# the full catalog pass separately after the bounded smoke test.
bun -e 'import { readConfig } from "./scripts/update-data.ts"; if (!readConfig().tickers.length) { console.error("Refusing unbounded dev refresh: set TICKERS in dev-run/request.txt"); process.exit(2); }'
mkdir -p dev-run
set +e
bun ./scripts/update-data.ts > dev-run/last-run.log 2>&1
status=$?
set -e
tail -n 400 dev-run/last-run.log
echo "updater exit status: $status" | tee -a dev-run/last-run.log
exit $status
- name: Commit generated data and log
if: always()
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add api dev-run/last-run.log
if git diff --cached --quiet; then echo "nothing to commit"; exit 0; fi
git commit -m "data: dev refresh of api/proshares [skip ci]"
git push