diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml new file mode 100644 index 00000000..cdad0a63 --- /dev/null +++ b/.github/workflows/dependabot.yml @@ -0,0 +1,30 @@ +name: Dependabot Auto Merge + +on: pull_request_target + +permissions: + pull-requests: write + contents: write + +jobs: + dependabot: + runs-on: ubuntu-latest + if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }} + steps: + - name: Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@v1 + + - name: Approve PR + if: ${{contains(steps.metadata.outputs.dependency-names, 'Z.EntityFramework.Plus.EFCore') && ${{ steps.metadata.outputs.update-type != 'version-update:semver-major' }} + run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{ github.event.pull_request.html_url }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Enable auto-merge for Dependabot PRs + if: ${{contains(steps.metadata.outputs.dependency-names, 'Z.EntityFramework.Plus.EFCore') && steps.metadata.outputs.update-type != 'version-update:semver-major'}} + run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GH_TOKEN: ${{secrets.GITHUB_TOKEN}} \ No newline at end of file diff --git a/src/BUTR.Site.NexusMods.sln b/src/BUTR.Site.NexusMods.sln index 0e409e5b..c8984939 100644 --- a/src/BUTR.Site.NexusMods.sln +++ b/src/BUTR.Site.NexusMods.sln @@ -27,6 +27,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{ ..\.github\workflows\deploy-self-hosted.yml = ..\.github\workflows\deploy-self-hosted.yml ..\.github\workflows\dotnet-format-daily.yml = ..\.github\workflows\dotnet-format-daily.yml ..\.github\workflows\frontend.yml = ..\.github\workflows\frontend.yml + ..\.github\workflows\dependabot.yml = ..\.github\workflows\dependabot.yml EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BUTR.Site.NexusMods.ServerClient", "BUTR.Site.NexusMods.ServerClient\BUTR.Site.NexusMods.ServerClient.csproj", "{26AE4C2C-03BF-44B1-872F-8FD1573C9E90}"