diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 6a6a920..da2c087 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1,8 @@ -* @wpengine/mario \ No newline at end of file +* @wpengine/mario + +# Dependency files: both the bot and the team are code owners for these paths +package.json @pe-domino-bot @wpengine/mario +package-lock.json @pe-domino-bot @wpengine/mario +Dockerfile @pe-domino-bot @wpengine/mario +.github/workflows/*.yml @pe-domino-bot @wpengine/mario +.github/workflows/*.yaml @pe-domino-bot @wpengine/mario diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 3f90009..6325eae 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,13 +4,23 @@ updates: directory: "/" schedule: interval: "daily" + ignore: + - dependency-name: "*" + update-types: ["version-update:semver-major"] + open-pull-requests-limit: 10 + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + ignore: + - dependency-name: "*" + update-types: ["version-update:semver-major"] open-pull-requests-limit: 10 - reviewers: - - "wpengine/mario" - package-ecosystem: "npm" directory: "/" schedule: interval: "daily" + ignore: + - dependency-name: "*" + update-types: ["version-update:semver-major"] open-pull-requests-limit: 10 - reviewers: - - "wpengine/mario" diff --git a/.github/workflows/dependabot-automation.yaml b/.github/workflows/dependabot-automation.yaml new file mode 100644 index 0000000..5f27898 --- /dev/null +++ b/.github/workflows/dependabot-automation.yaml @@ -0,0 +1,29 @@ +name: Dependabot Automation +on: pull_request + +permissions: + contents: write + pull-requests: write + +jobs: + dependabot: + runs-on: ubuntu-latest + if: ${{github.actor == 'dependabot[bot]'}} + steps: + - name: Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.0 + with: + github-token: "${{secrets.GITHUB_TOKEN}}" + - name: Approve PR + if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'}} + env: + PR_URL: ${{github.event.pull_request.html_url}} + GH_TOKEN: ${{secrets.BOT_APPROVAL_TOKEN}} + run: gh pr review --approve "$PR_URL" + - name: Enable auto-merge + if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'}} + env: + PR_URL: ${{github.event.pull_request.html_url}} + GH_TOKEN: ${{secrets.BOT_APPROVAL_TOKEN}} + run: gh pr merge --auto --squash "$PR_URL"