Skip to content

Commit

Permalink
only enable auto-merge not approval
Browse files Browse the repository at this point in the history
Signed-off-by: cpanato <[email protected]>
  • Loading branch information
cpanato committed Sep 29, 2023
1 parent 4b2cf0f commit 34f336a
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/auto-merge-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,6 @@ jobs:
- if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-patch' }}
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0

- name: Approve a PR if not already approved
if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-patch' }}
run: |
gh pr checkout "$PR_URL" # sets the upstream metadata for `gh pr status`
if [ "$(gh pr status --json reviews -q '[.currentBranch.reviews[]| select(type=="object" and has("state"))| .state | select(match("APPROVED"))] | unique | .[0]')" != "APPROVED" ];
then gh pr review --approve "$PR_URL"
else echo "PR already approved, skipping additional approvals to minimize emails/notification noise.";
fi
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Enable auto-merge for Dependabot PRs
if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch' }}
run: gh pr merge --auto --squash "$PR_URL"
Expand Down

0 comments on commit 34f336a

Please sign in to comment.