-
Notifications
You must be signed in to change notification settings - Fork 24
47 lines (39 loc) · 1.34 KB
/
dependabot_pr.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: 🤖 Dependabot PR
on:
pull_request_target:
branches:
- main
permissions:
contents: write
pull-requests: write
jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.DEPENDABOT_UPDATE_TOKEN }}
ref: ${{ github.event.pull_request.head.sha }}
- name: Install Rust Toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install cargo-hakari
uses: taiki-e/install-action@v2
with:
tool: cargo-hakari
- name: Run cargo-hakari
run: |
cargo hakari generate
- name: Check for modified files
id: git-check
run: echo modified=$(if [[ $(git diff) ]]; then echo "true"; else echo "false"; fi) >> $GITHUB_OUTPUT
- name: Push changes
if: steps.git-check.outputs.modified == 'true'
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
git commit -am "chore(deps): cargo hakari"
git push --force-with-lease origin HEAD:refs/heads/${{ github.head_ref }}