forked from anza-xyz/agave
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (57 loc) · 2.19 KB
/
Copy pathdependabot-pr.yml
File metadata and controls
68 lines (57 loc) · 2.19 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Dependabot PR
on:
pull_request:
branches:
- master
jobs:
dependabot:
timeout-minutes: 10
runs-on: ubuntu-24.04
if: github.actor == 'dependabot[bot]'
steps:
- name: Create github app token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
id: app-token
with:
client-id: ${{ secrets.CLIENT_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- name: Set git config
run: |
git config --global user.email "49699333+dependabot[bot]@users.noreply.github.com"
git config --global user.name "dependabot[bot]"
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf https://github.com/
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
- name: checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ steps.app-token.outputs.token }}
persist-credentials: false
- name: update code
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
input="$PR_TITLE"
regex='[Bb]ump (.+) from ([^ ]+) to ([^ ]+)( in .*)?'
if [[ ! "$input" =~ $regex ]]; then
echo "unexpected pattern"
exit 1
fi
crate_name="${BASH_REMATCH[1]}"
old_version="${BASH_REMATCH[2]}"
new_version="${BASH_REMATCH[3]}"
echo "crate_name: $crate_name, old_version: $old_version, new_version: $new_version"
cargo xtask update-crate --package $crate_name --from $old_version --to $new_version
./scripts/cargo-for-all-lock-files.sh --ignore-exit-code -- update -p $crate_name:$old_version --precise $new_version
./scripts/cargo-for-all-lock-files.sh tree
- name: push
run: |
if [ -z "$(git status --porcelain)" ]; then
echo "✅ Nothing to update"
else
git add **/Cargo.toml
git add **/Cargo.lock
git commit -am "Update all workspaces"
git push
fi