Skip to content

Commit 9402e68

Browse files
committed
Improve 'update crates' GH workflow.
1 parent d0fa219 commit 9402e68

File tree

3 files changed

+31
-45
lines changed

3 files changed

+31
-45
lines changed

.github/workflows/update-crate-versions.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Update crates versions
2+
3+
defaults:
4+
run:
5+
shell: bash
6+
7+
on:
8+
schedule:
9+
# Every Sunday at 00:00
10+
- cron: '0 0 * * 0'
11+
workflow_dispatch:
12+
13+
jobs:
14+
updateversions:
15+
runs-on: ubuntu-latest
16+
container:
17+
image: rust:1.57.0
18+
steps:
19+
- name: Check out the code
20+
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
21+
with:
22+
fetch-depth: 1
23+
ref: main
24+
- name: Retrieve newest versions of dependencies
25+
run: ./bin/update-crates-versions.sh
26+
- name: Create pull request
27+
run: |
28+
git checkout -b update-crates-versions
29+
git add local-registry/Cargo.toml
30+
git commit -m "Update crates versions"
31+
gh pr create --title "Update crates versions" --body "This is an automated pull request"

bin/update-crates-versions.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,3 @@ do
1111
latest_version=$(cargo search "$crate" | head -n 1 | awk -F"[ ]+" '{print $1 " = " $3}')
1212
sed -i -r "s/^$crate =.*/$latest_version/" $MANIFEST
1313
done <<< "$DEPS"
14-
15-
cat $MANIFEST

0 commit comments

Comments
 (0)