diff --git a/.github/workflows/dependabot-packagelock-update.yml b/.github/workflows/dependabot-packagelock-update.yml new file mode 100644 index 0000000..e280840 --- /dev/null +++ b/.github/workflows/dependabot-packagelock-update.yml @@ -0,0 +1,29 @@ +name: Check for dependabot update + +on: [pull_request] + +jobs: + restore: + name: Fix NuGet Lock Files + if: contains(github.head_ref, 'dependabot') && github.event_name == 'pull_request' + runs-on: windows-latest + steps: + - uses: actions/checkout@v5 + with: + ref: ${{ github.head_ref }} + token: ${{ secrets.GITHUB_TOKEN }} + + - run: dotnet restore --force-evaluate + - id: diff + continue-on-error: true + run: | + git add -N . + git diff --name-only --exit-code + + - if: steps.diff.outcome == 'failure' + run: | + git config user.email "github-actions[bot]@users.noreply.github.com" + git config user.name "github-actions[bot]" + git add . + git commit -m "chore(deps): update NuGet lock file" + git push