diff --git a/.github/workflows/review-pr.yml b/.github/workflows/review-pr.yml index f233f34..d70fa31 100644 --- a/.github/workflows/review-pr.yml +++ b/.github/workflows/review-pr.yml @@ -141,8 +141,14 @@ jobs: needs: [resolve-context] if: | always() && ( - (github.event_name == 'issue_comment' && github.event.issue.pull_request) || - (github.event_name == 'pull_request' && github.event.action != 'review_requested' && github.event.sender.type != 'Bot') || + (github.event_name == 'issue_comment' && + github.event.issue.pull_request && + github.event.comment.user.login != 'docker-agent' && + github.event.comment.user.login != 'docker-agent[bot]' && + github.event.comment.user.type != 'Bot' && + !contains(github.event.comment.body, '') && + !contains(github.event.comment.body, '')) || + (github.event_name == 'pull_request' && github.event.action != 'review_requested' && github.event.sender.type != 'Bot' && github.event.sender.login != 'docker-agent' && github.event.sender.login != 'docker-agent[bot]') || (github.event_name == 'pull_request' && github.event.action == 'review_requested' && github.event.requested_reviewer.login == 'docker-agent') || inputs.pr-number != '' || (needs.resolve-context.result == 'success' && needs.resolve-context.outputs.trigger-event == 'pull_request') @@ -372,7 +378,7 @@ jobs: if: | always() && needs.resolve-context.result != 'failure' && ( (github.event_name == 'pull_request_review_comment' && github.event.comment.in_reply_to_id && github.event.comment.user.login != 'docker-agent' && github.event.comment.user.type != 'Bot') || - (needs.resolve-context.result == 'success' && needs.resolve-context.outputs.trigger-event == 'pull_request_review_comment' && needs.resolve-context.outputs.comment-in-reply-to-id != '' && needs.resolve-context.outputs.comment-author != 'docker-agent') + (needs.resolve-context.result == 'success' && needs.resolve-context.outputs.trigger-event == 'pull_request_review_comment' && needs.resolve-context.outputs.comment-in-reply-to-id != '' && needs.resolve-context.outputs.comment-author != 'docker-agent' && needs.resolve-context.outputs.comment-author-type != 'Bot' && needs.resolve-context.outputs.comment-author != 'docker-agent[bot]') ) runs-on: ubuntu-latest permissions: diff --git a/.github/workflows/self-review-pr-trigger.yml b/.github/workflows/self-review-pr-trigger.yml index ffa8123..97f403e 100644 --- a/.github/workflows/self-review-pr-trigger.yml +++ b/.github/workflows/self-review-pr-trigger.yml @@ -9,7 +9,12 @@ permissions: {} jobs: save-context: - if: github.event.comment.user.login != 'docker-agent' + if: > + github.event.comment.user.login != 'docker-agent' && + github.event.comment.user.login != 'docker-agent[bot]' && + github.event.comment.user.type != 'Bot' && + !contains(github.event.comment.body, '') && + !contains(github.event.comment.body, '') runs-on: ubuntu-latest steps: - name: Save event context diff --git a/.github/workflows/self-review-pr.yml b/.github/workflows/self-review-pr.yml index 961621e..ecd8514 100644 --- a/.github/workflows/self-review-pr.yml +++ b/.github/workflows/self-review-pr.yml @@ -12,7 +12,12 @@ permissions: jobs: review: if: | - github.event_name == 'issue_comment' || + (github.event_name == 'issue_comment' && + github.event.comment.user.login != 'docker-agent' && + github.event.comment.user.login != 'docker-agent[bot]' && + github.event.comment.user.type != 'Bot' && + !contains(github.event.comment.body, '') && + !contains(github.event.comment.body, '')) || github.event.workflow_run.conclusion == 'success' uses: docker/cagent-action/.github/workflows/review-pr.yml@f208610469d69f20983cad64c577949a132caa33 # v1.5.3 permissions: diff --git a/review-pr/README.md b/review-pr/README.md index e77ef61..4df7a0d 100644 --- a/review-pr/README.md +++ b/review-pr/README.md @@ -56,6 +56,12 @@ permissions: {} jobs: save-context: + if: > + github.event.comment.user.login != 'docker-agent' && + github.event.comment.user.login != 'docker-agent[bot]' && + github.event.comment.user.type != 'Bot' && + !contains(github.event.comment.body, '') && + !contains(github.event.comment.body, '') runs-on: ubuntu-latest steps: - name: Save event context @@ -97,7 +103,12 @@ permissions: jobs: review: if: | - github.event_name == 'issue_comment' || + (github.event_name == 'issue_comment' && + github.event.comment.user.login != 'docker-agent' && + github.event.comment.user.login != 'docker-agent[bot]' && + github.event.comment.user.type != 'Bot' && + !contains(github.event.comment.body, '') && + !contains(github.event.comment.body, '')) || github.event.workflow_run.conclusion == 'success' uses: docker/cagent-action/.github/workflows/review-pr.yml@VERSION permissions: