File tree Expand file tree Collapse file tree 3 files changed +12
-63
lines changed Expand file tree Collapse file tree 3 files changed +12
-63
lines changed Original file line number Diff line number Diff line change 1- name : ' NuGet Lockfile Sync '
1+ name : ' Update Lockfiles '
22description : ' Force restore and commit updated NuGet lock files for Dependabot NuGet PRs'
3- inputs :
4- dotnet-version :
5- description : ' Dotnet SDK version'
6- required : false
7- default : ' 9.0.304'
83
94runs :
105 using : ' composite'
116 steps :
12- - name : Setup .NET
13- uses : actions/setup-dotnet@v4
14- with :
15- dotnet-version : ${{ inputs.dotnet-version }}
16-
177 - name : Force restore
188 shell : bash
199 run : dotnet restore --force-evaluate
@@ -24,11 +14,12 @@ runs:
2414 set -euo pipefail
2515 git config --global user.name 'dependabot[bot]'
2616 git config --global user.email '[email protected] ' 17+
2718 echo '*****STARTING LOCKFILE SYNC*****'
2819 git branch --show-current
29- git status
3020 git add -A
21+ git status
3122 git commit -m 'Update lock files' || echo 'No changes to commit'
3223 BRANCH_NAME="${{ github.head_ref || github.ref_name }}"
3324 echo "The branch name is $BRANCH_NAME"
34- git push origin "$BRANCH_NAME"
25+ git push
Original file line number Diff line number Diff line change 99 push :
1010 branches : [ "master" ]
1111
12+ permissions :
13+ contents : write
14+ pull-requests : write
15+
1216concurrency :
1317 group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-${{ github.event_name }}
1418 cancel-in-progress : true
2832 with :
2933 dotnet-version : 9.0.304
3034
35+ - name : Auto Update Lock Files (for Dependabot PRs)
36+ if : github.event_name == 'pull_request' && github.actor == 'dependabot[bot]' && startsWith(github.head_ref, 'dependabot/nuget/')
37+ uses : ./.github/actions/update-lockfiles
38+
3139 - name : Restore dependencies
3240 run : dotnet restore --locked-mode
3341
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments