name: Update dependencies
on:
  schedule:
    - cron: '0 0 1 * *'
  workflow_dispatch:

jobs:
  update:
    name: Update dependencies
    runs-on: ubuntu-latest
    if: github.repository == 'rust-lang/mdBook'
    steps:
      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0  # v7.0.0
      - name: Install Rust
        run: bash ci/install-rust.sh stable x86_64-unknown-linux-gnu
      - name: Install cargo-edit
        run: cargo install cargo-edit --locked
      - name: Update dependencies
        run: ci/update-dependencies.sh
        env:
          GH_TOKEN: ${{ github.token }}
