Skip to content

Skip bot-created issues in dedupe detect workflow#5328

Merged
peterzhuamazon merged 1 commit into
opensearch-project:mainfrom
qianheng-aws:fix/dedupe-skip-bot
Apr 9, 2026
Merged

Skip bot-created issues in dedupe detect workflow#5328
peterzhuamazon merged 1 commit into
opensearch-project:mainfrom
qianheng-aws:fix/dedupe-skip-bot

Conversation

@qianheng-aws

Copy link
Copy Markdown
Collaborator

Summary

  • Add condition to skip issues created by bots in the dedupe detect job to avoid unnecessary duplicate detection on automated issues (e.g., AUTOCUT)

Test plan

  • Create a bot-generated issue and verify the detect job is skipped
  • Create a human-generated issue and verify the detect job runs normally

Signed-off-by: Heng Qian <qianheng@amazon.com>
@github-actions

github-actions Bot commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🧪 No relevant tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ Recommended focus areas for review

Bot Detection

The condition checks github.event.issue.user.type != 'Bot' to filter out bot-created issues. It's worth validating whether GitHub's API consistently returns 'Bot' (capitalized) for all bot account types, including GitHub Apps and other automated accounts. Some automated accounts may have user.type set to 'User' even if they behave like bots (e.g., AUTOCUT if it uses a regular user token), which would cause the filter to be ineffective for those cases.

if: (github.event_name == 'issues' && github.event.issue.user.type != 'Bot') || (github.event_name == 'workflow_dispatch' && inputs.job == 'detect')

@github-actions

github-actions Bot commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Verify case-sensitive bot type comparison

The comparison github.event.issue.user.type != 'Bot' is case-sensitive in GitHub
Actions expressions. GitHub's API returns the user type as 'Bot' with a capital 'B',
but it's safer to also handle potential variations. Additionally, consider using !=
'Bot' alongside a check that the field exists to avoid issues when the field is null
or missing (e.g., for workflow_dispatch events where github.event.issue is not set).
Since the bot check is already inside the github.event_name == 'issues' condition,
the field should be present, but verifying the casing is correct is important.

.github/workflows/issue-dedupe.yml [25]

+if: (github.event_name == 'issues' && github.event.issue.user.type != 'Bot') || (github.event_name == 'workflow_dispatch' && inputs.job == 'detect')
 
-
Suggestion importance[1-10]: 2

__

Why: The existing_code and improved_code are identical, meaning no actual change is proposed. The suggestion only asks to verify that 'Bot' is correctly capitalized, which is already correct per GitHub's API documentation.

Low

@peterzhuamazon peterzhuamazon merged commit d984298 into opensearch-project:main Apr 9, 2026
37 of 38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Improves code quality, but not the product

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants