diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 0000000..2d112e9 --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,14 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + time: "00:00" + timezone: "Etc/UTC" + cooldown: + default-days: 1 + include: + - "*" + commit-message: + prefix: "chore" diff --git a/.github/workflows/dependabot-merges.yaml b/.github/workflows/dependabot-merges.yaml new file mode 100644 index 0000000..5d9200a --- /dev/null +++ b/.github/workflows/dependabot-merges.yaml @@ -0,0 +1,36 @@ +name: Dependabot Merges + +on: + pull_request: + types: + - opened + - reopened + - synchronize + +jobs: + approve-and-merge: + name: Approve & Merge + if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }} + + runs-on: ubuntu-latest + + permissions: + contents: write + pull-requests: write + + steps: + - name: Fetch Dependabot metadata + id: dependabot-metadata + uses: dependabot/fetch-metadata@v3 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - name: Approve PR + run: gh pr review --approve "${{github.event.pull_request.html_url}}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Merge PR + run: gh pr merge --auto --squash "${{github.event.pull_request.html_url}}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}