Skip to content

Commit 630297b

Browse files
CopilotBoshen
andcommitted
Add auto-update CI workflow for JavaScript globals (#75)
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: Boshen <[email protected]> Co-authored-by: Boshen <[email protected]>
1 parent 4e89ef6 commit 630297b

File tree

4 files changed

+76
-9
lines changed

4 files changed

+76
-9
lines changed

.github/workflows/auto-update.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Auto Update
2+
3+
permissions: {}
4+
5+
on:
6+
schedule:
7+
- cron: "0 2 * * *" # Run daily at 2 AM UTC
8+
workflow_dispatch:
9+
10+
jobs:
11+
update:
12+
name: Auto Update
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
steps:
17+
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
18+
19+
- uses: oxc-project/setup-rust@cd82e1efec7fef815e2c23d296756f31c7cdc03d # v1.0.0
20+
21+
- name: Run xtask to update globals
22+
run: cargo run -p xtask
23+
24+
- name: Check for changes
25+
id: verify-changed-files
26+
run: |
27+
if [ -n "$(git status --porcelain)" ]; then
28+
echo "changed=true" >> $GITHUB_OUTPUT
29+
else
30+
echo "changed=false" >> $GITHUB_OUTPUT
31+
fi
32+
33+
- name: Commit and push changes
34+
if: ${{ steps.verify-changed-files.outputs.changed }}
35+
run: |
36+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
37+
git config --global user.name "github-actions"
38+
git add .
39+
git commit -m "Auto update globals from upstream"
40+
git push

.github/workflows/ci.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@ concurrency:
1818
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
1919
cancel-in-progress: ${{ github.ref_name != 'main' }}
2020

21-
defaults:
22-
run:
23-
shell: bash
24-
25-
env:
26-
CARGO_INCREMENTAL: 0
27-
RUSTFLAGS: "-D warnings"
28-
2921
jobs:
3022
test:
3123
name: Test

Cargo.lock

Lines changed: 35 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

xtask/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ lazy_static = "1.5.0"
1212
phf_codegen = "0.13.0"
1313
rustc-hash = "2"
1414
serde = { version = "1", features = ["derive"] }
15-
ureq = { version = "3.0.5", default-features = false, features = ["json", "rustls"] }
15+
ureq = { version = "3.0.5", features = ["json"] }

0 commit comments

Comments
 (0)