From de6e791e8113b6d5c5adee1205811c8c95cbef6f Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Sat, 15 Aug 2020 14:21:58 +0900 Subject: [PATCH] Update documentation --- docs/examples.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/docs/examples.md b/docs/examples.md index b47dcd1..c26c828 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -6,6 +6,7 @@ - [Use case: Create a pull request to update X periodically](#use-case-create-a-pull-request-to-update-x-periodically) - [Update NPM dependencies](#update-npm-dependencies) - [Update Gradle dependencies](#update-gradle-dependencies) + - [Update Cargo dependencies](#update-cargo-dependencies) - [Update SwaggerUI for GitHub Pages](#update-swaggerui-for-github-pages) - [Spider and download a website](#spider-and-download-a-website) - [Use case: Create a pull request to update X by calling the GitHub API](#use-case-create-a-pull-request-to-update-x-by-calling-the-github-api) @@ -183,6 +184,41 @@ jobs: branch: update-dependencies ``` +### Update Cargo dependencies + +The following workflow will create a pull request for Cargo dependencies. +It optionally uses [`cargo-edit`](https://github.com/killercup/cargo-edit) to update `Cargo.toml` and keep it in sync with `Cargo.lock`. + +```yml +name: Update Dependencies +on: + schedule: + - cron: '0 1 * * 1' +jobs: + update-dep: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Update dependencies + run: | + cargo install cargo-edit + cargo update + cargo upgrade --to-lockfile + - name: Create Pull Request + uses: peter-evans/create-pull-request@v3 + with: + token: ${{ secrets.PAT }} + commit-message: Update dependencies + title: Update dependencies + body: | + - Dependency updates + + Auto-generated by [create-pull-request][1] + + [1]: https://github.com/peter-evans/create-pull-request + branch: update-dependencies +``` + ### Update SwaggerUI for GitHub Pages When using [GitHub Pages to host Swagger documentation](https://github.com/peter-evans/swagger-github-pages), this workflow updates the repository with the latest distribution of [SwaggerUI](https://github.com/swagger-api/swagger-ui).