-
Notifications
You must be signed in to change notification settings - Fork 5
49 lines (40 loc) · 1.6 KB
/
datagen.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: Automatic Datagen
on:
workflow_dispatch:
schedule:
- cron: '30 14 * * *'
jobs:
test-commit-and-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: main
- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Set up Git with new branch
run: |
git config --global user.name 'GitHub Action'
git config --global user.email '[email protected]'
git checkout -b datagen-$(date +%Y-%m-%d)
- name: Edit datagen-runs.txt
run: |
echo "$(date +%Y-%m-%d)" >> datagen-runs.txt
- name: Run datagen
run: |
cd datagen
cargo run --bin jupiterp_datagen -- -t 202501
cd ..
- name: Commit and push to origin
run: |
git add --all
git commit -m "Daily automated datagen" || exit 0
git push origin datagen-$(date +%Y-%m-%d)
- name: Open pull request
run: |
gh pr create -B main -H datagen-$(date +%Y-%m-%d) --title "[AUTOMATED] Automatic Datagen $(date +%Y-%m-%d)" --body 'Run datagen; automated, created by GitHub Action.' --reviewer atcupps
gh pr edit datagen-$(date +%Y-%m-%d) --add-label AUTOMATED
gh pr edit data-update --add-label AUTOMATED
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}