diff --git a/.github/workflows/pr_auto_approval.yml b/.github/workflows/pr_auto_approval.yml new file mode 100644 index 0000000..aab4c8a --- /dev/null +++ b/.github/workflows/pr_auto_approval.yml @@ -0,0 +1,27 @@ +on: + pull_request: + types: + - opened + branches: + - '*' + +jobs: + approve: + name: Auto-approve docker push pr + runs-on: ubuntu-latest + if: | + startsWith(github.event.pull_request.head.ref, 'docker_files_push_') && + github.event.pull_request.user.login == 'elasticmachine' + permissions: + pull-requests: write + contents: write + steps: + - name: Debug PR info + run: | + echo "PR Head Ref: ${{ github.event.pull_request.head.ref }}" + echo "PR User Login: ${{ github.event.pull_request.user.login }}" + + - name: Auto Approve + uses: hmarr/auto-approve-action@v3 + with: + github_token: ${{secrets.ELASTICMACHINE_TOKEN}}