name: Dependabot auto-merge on: pull_request permissions: pull-requests: write contents: write repository-projects: write jobs: dependabot: runs-on: ubuntu-latest if: ${{ github.actor == 'dependabot[bot]' }} steps: - name: Dependabot metadata id: metadata uses: dependabot/fetch-metadata@v1.6.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" - name: Enable auto-merge for Dependabot PRs # Automatically merge the following dependency upgrades: if: "${{ steps.metadata.outputs.dependency-names == '@actions/core' || steps.metadata.outputs.dependency-names == '@automattic/color-studio' || steps.metadata.outputs.dependency-names == '@babel/cli' || steps.metadata.outputs.dependency-names == '@babel/core' || steps.metadata.outputs.dependency-names == '@babel/plugin-proposal-class-properties' || steps.metadata.outputs.dependency-names == '@babel/plugin-syntax-jsx' || steps.metadata.outputs.dependency-names == '@babel/polyfill' || steps.metadata.outputs.dependency-names == '@types/classnames' || steps.metadata.outputs.dependency-names == '@types/dinero.js' || steps.metadata.outputs.dependency-names == '@types/dompurify' || steps.metadata.outputs.dependency-names == '@types/gtag.js' || steps.metadata.outputs.dependency-names == '@types/jest' || steps.metadata.outputs.dependency-names == '@types/jest-environment-puppeteer' || steps.metadata.outputs.dependency-names == '@types/jquery' || steps.metadata.outputs.dependency-names == '@types/lodash' || steps.metadata.outputs.dependency-names == '@types/puppeteer' || steps.metadata.outputs.dependency-names == '@types/react' || steps.metadata.outputs.dependency-names == '@types/react-dom' || steps.metadata.outputs.dependency-names == '@types/wordpress__block-editor' || steps.metadata.outputs.dependency-names == '@types/wordpress__blocks' || steps.metadata.outputs.dependency-names == '@types/wordpress__data' || steps.metadata.outputs.dependency-names == '@types/wordpress__data-controls' || steps.metadata.outputs.dependency-names == '@types/wordpress__editor' || steps.metadata.outputs.dependency-names == '@types/wordpress__notices' || steps.metadata.outputs.dependency-names == '@typescript-eslint/eslint-plugin' || steps.metadata.outputs.dependency-names == '@typescript-eslint/parser' || steps.metadata.outputs.dependency-names == 'chalk' || steps.metadata.outputs.dependency-names == 'circular-dependency-plugin' || steps.metadata.outputs.dependency-names == 'commander' || steps.metadata.outputs.dependency-names == 'copy-webpack-plugin' || steps.metadata.outputs.dependency-names == 'eslint-import-resolver-typescript' || steps.metadata.outputs.dependency-names == 'gh-pages' || steps.metadata.outputs.dependency-names == 'markdown-it' || steps.metadata.outputs.dependency-names == 'promptly' || steps.metadata.outputs.dependency-names == 'react-docgen' || steps.metadata.outputs.dependency-names == 'wp-types' }}" run: | gh pr edit --add-label 'dependencies-auto-merged' "$PR_URL" gh pr review --approve "$PR_URL" gh pr merge --auto --squash "$PR_URL" env: PR_URL: ${{github.event.pull_request.html_url}} GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}