diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..81349261 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,34 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + groups: + github-actions: + patterns: + - "*" + + - package-ecosystem: "nuget" + directories: + - "/**" + schedule: + interval: "weekly" + open-pull-requests-limit: 5 + groups: + nuget: + patterns: + - "*" + group-by: dependency-name + + - package-ecosystem: "npm" + directories: + - "/**" + schedule: + interval: "weekly" + open-pull-requests-limit: 5 + groups: + npm: + patterns: + - "*" + group-by: dependency-name diff --git a/.github/workflows/dependabot-approve-merge.yml b/.github/workflows/dependabot-approve-merge.yml new file mode 100644 index 00000000..40427eae --- /dev/null +++ b/.github/workflows/dependabot-approve-merge.yml @@ -0,0 +1,28 @@ +name: dependabot +on: pull_request + +permissions: + contents: write + pull-requests: write + +jobs: + auto-merge: + runs-on: ubuntu-latest + if: ${{ github.actor == 'dependabot[bot]' && github.repository_owner == 'dotnet' && github.base_ref == 'main' }} + steps: + - name: Harden Runner + uses: step-security/harden-runner@ccd8616d44fd3846e67624a50d5aad6d37bf2d25 # v2.22.1 + with: + egress-policy: audit + + - name: Auto-approve PR + run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + + - name: Auto-merge PR + run: gh pr merge --auto --squash "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}