Pull ci #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: rustc-pull | |
on: | |
workflow_dispatch: | |
pull_request: | |
schedule: | |
# Run at 04:00 UTC every Monday | |
- cron: '0 4 * * 1' | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
pull: | |
#if: github.repository == 'rust-lang/rustc-dev-guide' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: '0' | |
- name: Install stable Rust toolchain | |
run: rustup update stable | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: "josh-sync" | |
cache-directories: "/home/runner/.cache/rustc-dev-guide-josh" | |
- name: Install Josh | |
run: RUSTFLAGS="--cap-lints warn" cargo +stable install josh-proxy --git https://github.com/josh-project/josh --tag r24.10.04 | |
- name: Setup bot git name and email | |
run: | | |
git config --global user.name 'The rustc-dev-guide Cronjob Bot' | |
git config --global user.email '[email protected]' | |
- name: Perform rustc-pull | |
run: cargo run --manifest-path josh-sync/Cargo.toml -- rustc-pull | |
- name: Push changes to a branch | |
run: | | |
BRANCH="rustc-pull-$(date -u +%Y-%m-%d)" | |
git switch -c $BRANCH | |
git push -u origin $BRANCH | |
- name: Create pull request | |
run: | | |
gh pr create -B master --title 'Rustc pull update' --body 'Latest update from rustc.' | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |