Skip to content

Keep Cargo.lock up to date #65

Keep Cargo.lock up to date

Keep Cargo.lock up to date #65

# This file is part of the rust-for-it project.
#
# Copyright (c) 2023 Sebastian Pipping <[email protected]>
# SPDX-License-Identifier: MIT
name: Keep Cargo.lock up to date
on:
schedule:
- cron: '0 16 * * 5' # Every Friday 4pm
workflow_dispatch:
# NOTE: This will drop all permissions from GITHUB_TOKEN except metadata read,
# and then (re)add the ones listed below:
permissions:
contents: write
pull-requests: write
jobs:
cargo_lock_autoupdate:
name: Keep Cargo.lock up to date
runs-on: ubuntu-22.04
steps:
- name: Check out
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Check for outdated Rust dependencies
run: |-
cargo update
git diff
- name: Create pull request from changes (if any)
id: create-pull-request
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0
with:
author: 'cargo-update <[email protected]>'
base: main
body: |-
For your consideration.
:warning: Please **CLOSE AND RE-OPEN** this pull request so that [further workflow runs get triggered](https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs) for this pull request.
branch: cargo-update
commit-message: "Cargo.lock: Mass-upgrade"
delete-branch: true
draft: true
labels: enhancement
title: "Cargo.lock: Mass-upgrade"
- name: Log pull request URL
if: "${{ steps.create-pull-request.outputs.pull-request-url }}"
run: |
echo "Pull request URL is: ${{ steps.create-pull-request.outputs.pull-request-url }}"