Add Dependabot automatic approval and merge #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions | |
| name: Dependabot auto-approve and merge | |
| on: pull_request | |
| permissions: | |
| pull-requests: write | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| jobs: | |
| dependabot: | |
| runs-on: ubuntu-latest | |
| if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'splunk/splunk-sdk-python' | |
| steps: | |
| - name: Dependabot metadata | |
| uses: dependabot/fetch-metadata@496eb7a6d053154f00e01044ab472077386f5a35 | |
| with: | |
| github-token: "${{ secrets.GITHUB_TOKEN }}" | |
| - name: Approve and auto-merge | |
| run: | | |
| gh pr review --approve "${{ github.event.pull_request.html_url }}" | |
| gh pr merge --auto --merge "${{ github.event.pull_request.html_url }}" |