Skip to content

Commit e88e69c

Browse files
authored
CI: Create regenerate-target-info (#1055)
* CI: Create regenerate-target-info For automatically regenerate target_info.rs * Update step for generating branch name in regenerate-target-info
1 parent 2c85112 commit e88e69c

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Regenerate target info
2+
3+
on:
4+
workflow_dispatch: # Allow running on-demand
5+
schedule:
6+
- cron: '0 3 * * 5'
7+
8+
jobs:
9+
regenerate:
10+
name: Regenerate target info & Open Pull Request if necessary
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
persist-credentials: true
16+
17+
- name: Generate branch name
18+
run: |
19+
git checkout -b regenerate-target-info/${{ github.run_id }}
20+
21+
- name: Install rust
22+
run: |
23+
rustup toolchain install stable --no-self-update --profile minimal
24+
25+
- name: Regenerate target info
26+
run: cargo run --bin gen-target-info
27+
28+
- name: Detect changes
29+
id: changes
30+
run:
31+
# This output boolean tells us if the dependencies have actually changed
32+
echo "count=$(git status --porcelain=v1 | wc -l)" >> $GITHUB_OUTPUT
33+
34+
- name: Commit and push changes
35+
# Only push if changes exist
36+
if: steps.changes.outputs.count > 0
37+
run: |
38+
git config user.name github-actions
39+
git config user.email [email protected]
40+
git commit -am "dep: Regenerate target info"
41+
git push origin HEAD
42+
43+
- name: Open pull request if needed
44+
if: steps.changes.outputs.count > 0
45+
env:
46+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
run: |
48+
gh pr create --base main --fill

0 commit comments

Comments
 (0)