Skip to content

Commit 79fda33

Browse files
committed
Add CI workflow for performing rustc-pull
1 parent 7d59cb3 commit 79fda33

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

.github/workflows/rustc-pull.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: rustc-pull
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
schedule:
7+
# Run at 04:00 UTC every Monday
8+
- cron: '0 4 * * 1'
9+
10+
jobs:
11+
pull:
12+
#if: github.repository == 'rust-lang/rustc-dev-guide'
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
pull-requests: write
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Install stable Rust toolchain
20+
run: rustup update stable
21+
- uses: Swatinem/rust-cache@v2
22+
with:
23+
workspaces: "josh-sync"
24+
- name: Install Josh
25+
run: RUSTFLAGS="--cap-lints warn" cargo +stable install josh-proxy --git https://github.com/josh-project/josh --tag r24.10.04
26+
- name: Setup bot git name and email
27+
run: |
28+
git config --global user.name 'The rustc-dev-guide Cronjob Bot'
29+
git config --global user.email '[email protected]'
30+
- name: Perform rustc-pull
31+
run: cargo run --manifest-path josh-sync/Cargo.toml -- rustc-pull
32+
- name: Push changes to a branch
33+
run: |
34+
BRANCH="rustc-pull-$(date -u +%Y-%m-%d)"
35+
git switch -c $BRANCH
36+
git push -u origin $BRANCH
37+
- name: Create pull request
38+
run: |
39+
gh pr create -B master --title 'Rustc pull update' --body 'Latest update from rustc.'
40+
# env:
41+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

triagebot.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ allow-unauthenticated = [
66
"waiting-on-author",
77
"blocked",
88
]
9+
10+
# Automatically close and reopen PRs made by bots to run CI on them
11+
[bot-pull-requests]

0 commit comments

Comments
 (0)