|
9 | 9 | workflow_dispatch: |
10 | 10 | # Needed so we can run it manually |
11 | 11 |
|
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 |
28 | 15 |
|
29 | 16 | jobs: |
30 | 17 | 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