forked from Finbuckle/Finbuckle.MultiTenant
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (45 loc) · 1.65 KB
/
Copy pathdependabot-clone.yml
File metadata and controls
52 lines (45 loc) · 1.65 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
name: Dependabot Clone
on:
workflow_dispatch:
schedule:
- cron: '0 1 * * *'
jobs:
check-and-update-dependencies:
runs-on: ubuntu-latest
strategy:
matrix:
branch: [ main, 9.x, 8.x ]
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10
- name: Checkout Finbuckle.MultiTenant
uses: actions/checkout@v5
with:
ref: ${{ matrix.branch }}
fetch-depth: 0
- name: Checkout branch for update
run: git checkout -b fix/update-dependencies-${{ matrix.branch }} || git checkout fix/update-dependencies-${{ matrix.branch }}
continue-on-error: true
- name: Restore dependencies
run: dotnet restore --force-evaluate
- name: Check for changes in a packages.lock.json
id: check-for-changes
run: git diff --exit-code src/*/packages.lock.json || echo CHANGED=1 >> $GITHUB_ENV
continue-on-error: true
- name: Push changes if changed
if: env.CHANGED == '1'
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git add .
git commit -m "fix: update dependencies"
git push origin fix/update-dependencies-${{ matrix.branch }}
- name: Create PR if changed
if: env.CHANGED == '1'
env:
GH_TOKEN: ${{ github.token }}
run: |
gh pr create --title "Update dependencies for ${{ matrix.branch }}" --body "This PR updates project dependencies." --head fix/update-dependencies-${{ matrix.branch }} --base ${{ matrix.branch }}
continue-on-error: true