Skip to content

Commit 55badd4

Browse files
authored
ci: use reusable cargo update workflow (#9690)
1 parent 9829054 commit 55badd4

File tree

1 file changed

+6
-47
lines changed

1 file changed

+6
-47
lines changed

.github/workflows/dependencies.yml

Lines changed: 6 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -9,53 +9,12 @@ on:
99
workflow_dispatch:
1010
# Needed so we can run it manually
1111

12-
env:
13-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14-
BRANCH: cargo-update
15-
TITLE: "chore(deps): weekly `cargo update`"
16-
BODY: |
17-
Automation to keep dependencies in `Cargo.lock` current.
18-
19-
<details><summary><strong>cargo update log</strong></summary>
20-
<p>
21-
22-
```log
23-
$cargo_update_log
24-
```
25-
26-
</p>
27-
</details>
12+
permissions:
13+
contents: write
14+
pull-requests: write
2815

2916
jobs:
3017
update:
31-
name: Update
32-
runs-on: ubuntu-latest
33-
steps:
34-
- uses: actions/checkout@v4
35-
- uses: dtolnay/rust-toolchain@nightly
36-
37-
- name: cargo update
38-
# Remove first line that always just says "Updating crates.io index"
39-
run: cargo update --color never 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log
40-
41-
- name: craft commit message and PR body
42-
id: msg
43-
run: |
44-
export cargo_update_log="$(cat cargo_update.log)"
45-
46-
echo "commit_message<<EOF" >> $GITHUB_OUTPUT
47-
printf "$TITLE\n\n$cargo_update_log\n" >> $GITHUB_OUTPUT
48-
echo "EOF" >> $GITHUB_OUTPUT
49-
50-
echo "body<<EOF" >> $GITHUB_OUTPUT
51-
echo "$BODY" | envsubst >> $GITHUB_OUTPUT
52-
echo "EOF" >> $GITHUB_OUTPUT
53-
54-
- name: Create Pull Request
55-
uses: peter-evans/create-pull-request@v6
56-
with:
57-
add-paths: ./Cargo.lock
58-
commit-message: ${{ steps.msg.outputs.commit_message }}
59-
title: ${{ env.TITLE }}
60-
body: ${{ steps.msg.outputs.body }}
61-
branch: ${{ env.BRANCH }}
18+
uses: ithacaxyz/ci/.github/workflows/cargo-update-pr.yml@main
19+
secrets:
20+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)