-
Notifications
You must be signed in to change notification settings - Fork 11
26 lines (26 loc) · 1.2 KB
/
cargo_lock.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
name: "Update Cargo.lock"
on:
schedule:
- cron: '0 3 * * 1' # On Monday, 03:00 UTC
workflow_dispatch: {}
jobs:
cargo_update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4 # Only implemented for `main` branch.
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: echo "BRANCH_NAME=automation/cargo_update$(date +%s)" >> "$GITHUB_OUTPUT"
id: branch_name
- run: git checkout -b ${{ steps.branch_name.outputs.BRANCH_NAME }}
- run: cargo update
- run: git config --global user.email "[email protected]"
- run: git config --global user.name "cmkrmk"
- run: git add .
# This git commit may be empty, in which case this step will fail. However, since this action
# runs only once a week, this should not affect us. Any error is likely worth investigating.
- run: git commit -m "Update Cargo.lock" -m "Created automatically." -o Cargo.lock
- run: git push origin HEAD
- name: "Create pull request"
run: gh pr create -B main -H ${{ steps.branch_name.outputs.BRANCH_NAME }} --title "Update Cargo.lock" --body "Created automatically."
env:
GITHUB_TOKEN: ${{ secrets.CMKRMK_PAT }}