diff --git a/.github/workflows/auto_merge.yml b/.github/workflows/auto_merge.yml index 7a0ac1f5..1c30a96d 100644 --- a/.github/workflows/auto_merge.yml +++ b/.github/workflows/auto_merge.yml @@ -78,12 +78,12 @@ jobs: contents: write pull-requests: write name: Auto Approve PRs by Dependabot - needs: [static-checks, static-checks-azure] + needs: [static-checks] runs-on: ubuntu-latest if: | always() && github.actor == 'dependabot[bot]' && - (needs.static-checks.result == 'success' || needs.static-checks-azure.result == 'success') + (needs.static-checks.result == 'success' || needs.static-checks-azure.result == 'success') && !inputs.azure_cloud steps: - name: Approve PR via GitHub Bot run: gh pr review --approve "$PR_URL" @@ -97,6 +97,51 @@ jobs: PR_URL: ${{github.event.pull_request.html_url}} GITHUB_TOKEN: ${{secrets.GITHUB}} + autoapprove-azure: + permissions: + contents: write + pull-requests: write + name: Auto Approve PRs by Dependabot + needs: [static-checks-azure] + runs-on: ubuntu-latest + if: | + always() && + github.actor == 'dependabot[bot]' && + (needs.static-checks.result == 'success' || needs.static-checks-azure.result == 'success') && + inputs.azure_cloud == true + steps: + - name: Approve PR via GitHub Bot + run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + + - name: Approve PR via Anmol Nagpal + run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB}} + + automerge-azure: + runs-on: ubuntu-latest + needs: autoapprove-azure + if: | + always() && + needs.autoapprove.result == 'success' && + github.event_name == 'pull_request' && + github.event.pull_request.draft == false && + inputs.azure_cloud == true + steps: + - name: Automerge + uses: pascalgn/automerge-action@v0.16.4 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB }} + MERGE_FILTER_AUTHOR: 'dependabot[bot]' + MERGE_METHOD: "merge" + MERGE_DELETE_BRANCH: "true" + MERGE_LABELS: "dependencies, github_actions" + MERGE_REQUIRED_APPROVALS: "" + automerge: runs-on: ubuntu-latest needs: autoapprove @@ -104,7 +149,7 @@ jobs: always() && needs.autoapprove.result == 'success' && github.event_name == 'pull_request' && - github.event.pull_request.draft == false + github.event.pull_request.draft == false && !inputs.azure_cloud steps: - name: Automerge uses: pascalgn/automerge-action@v0.16.4 @@ -115,4 +160,5 @@ jobs: MERGE_DELETE_BRANCH: "true" MERGE_LABELS: "dependencies, github_actions" MERGE_REQUIRED_APPROVALS: "" + ...