generated from nogic1008/dotnet-ci-example
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: update lock file on dependabot pushed (#29)
workaround for dependabot/dependabot-core#1303
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Update NuGet Lock file | ||
|
||
on: | ||
push: | ||
branches: | ||
- dependabot/nuget/** | ||
|
||
jobs: | ||
update: | ||
name: Update NuGet Lock file | ||
if: contains(github.actor, 'dependabot') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2.3.4 | ||
- uses: actions/cache@v2.1.6 | ||
with: | ||
path: ${{ env.NUGET_PACKAGES }} | ||
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-nuget- | ||
- name: Setup .NET Core 3.1 SDK | ||
uses: actions/setup-dotnet@v1.8.1 | ||
with: | ||
dotnet-version: 3.1.x | ||
- name: Setup .NET 5.0 SDK | ||
uses: actions/setup-dotnet@v1.8.1 | ||
with: | ||
dotnet-version: 5.0.x | ||
|
||
- name: Restore | ||
run: dotnet restore | ||
|
||
- name: Count changes | ||
id: changes | ||
run: | | ||
git add -N . | ||
echo "::set-output name=count::$(git diff --name-only | wc -l)" | ||
- name: Commit & Push | ||
if: steps.changes.outputs.count > 0 | ||
run: | | ||
git config user.name github-actions | ||
git config user.email github-actions@github.com | ||
git add . | ||
git commit -m "chore(deps): update NuGet lock files" | ||
git push |