-
Notifications
You must be signed in to change notification settings - Fork 187
68 lines (61 loc) · 2.23 KB
/
code_generators.yml
File metadata and controls
68 lines (61 loc) · 2.23 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
63
64
65
66
67
68
name: Run All Code Generators
on:
schedule:
- cron: "0 10 * * 5" # Runs "at 10 UTC every Friday" (see https://crontab.guru)
workflow_dispatch: # Run on manual trigger
jobs:
run_all:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install beautifulsoup4==4.14.3 pandas==2.3.3
- name: Configure git
run: |
git config user.name "GitHub Actions"
git config user.email "github-actions@github.com"
- name: Run all code generators
run: |
failed=""
for script in \
Alternative-Datasets-Code-Generator \
eodhd-macro-indicators-code-generator \
fred-categories-table-code-generator \
fundamentals-table-code-generator \
future-table-code-generator \
glossary-generator \
Lean-CLI-API-Reference-Code-Generator \
market-hour-code-generator \
Supported-Assets-Table-Code-Generator \
us-energy-indicators-code-generator \
indicator_reference_code_generator; do
echo "::group::Running $script"
if ! python "code-generators/$script.py"; then
echo "::error::$script failed"
failed="$failed $script"
fi
if [[ -n $(git status --porcelain) ]]; then
git add -A
git commit -m "Code generated by $script.py"
fi
echo "::endgroup::"
done
if [[ -n "$failed" ]]; then
echo "::error::Failed scripts:$failed"
echo "has_failures=true" >> "$GITHUB_ENV"
fi
- name: Create Pull Request
if: always()
uses: peter-evans/create-pull-request@v8
with:
branch: github-action-code-generators
title: "Update auto-generated code"
body: "Automated changes from code generators."
committer: "GitHub Actions <github-actions@github.com>"
author: "GitHub Actions <github-actions@github.com>"
- name: Fail if any scripts errored
if: env.has_failures == 'true'
run: exit 1