Skip to content

Commit c54e189

Browse files
committed
use composite
1 parent 227d6bb commit c54e189

File tree

3 files changed

+12
-63
lines changed

3 files changed

+12
-63
lines changed
Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,9 @@
1-
name: 'NuGet Lockfile Sync'
1+
name: 'Update Lockfiles'
22
description: '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

94
runs:
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

.github/workflows/build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
push:
1010
branches: [ "master" ]
1111

12+
permissions:
13+
contents: write
14+
pull-requests: write
15+
1216
concurrency:
1317
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-${{ github.event_name }}
1418
cancel-in-progress: true
@@ -28,6 +32,10 @@ jobs:
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

.github/workflows/nuget-lockfile-sync.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)