diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e7406ac..8d37ca1 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,11 +1,13 @@ ---- version: 2 updates: - - package-ecosystem: 'github-actions' - directory: '/' + - package-ecosystem: "github-actions" + directory: "/" schedule: - interval: 'daily' - - package-ecosystem: 'gomod' - directory: '/' + interval: "daily" + time: "02:03" + + - package-ecosystem: "gomod" + directory: "/" schedule: - interval: 'daily' + interval: "daily" + time: "02:03" diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml new file mode 100644 index 0000000..14ceefb --- /dev/null +++ b/.github/workflows/dependabot.yml @@ -0,0 +1,32 @@ +# Autogenerated by https://github.com/appkins/ecu/github + +name: Dependabot auto-approve +on: + pull_request_target: + types: [opened] + +permissions: + pull-requests: write + contents: write + +jobs: + dependabot: + runs-on: ubuntu-latest + if: ${{ github.actor == 'dependabot[bot]' }} + steps: + - name: Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@v2.2.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - name: Approve a PR + if: ${{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 + run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}