Skip to content

Conversation

NKD52
Copy link

@NKD52 NKD52 commented Sep 4, 2025

Fixes #1363

Changes

Added a new workflow (.github/workflows/auto-reply.yml)
Detects assignment requests in issue comments using regex (e.g. “please assign”, “can I work on this”, “assign me”, etc.)
Automatically replies with a standard message:
“Please go ahead and create a PR when you are ready. We do not formally assign issues. Contributors are free to pick up any open issue based on their availability. You can open a PR or even a draft PR to let others know that you’re working on it.”

This saves time for moderators by reducing repetitive responses to assignment requests.
The code uses simple regex to track the commentors message and check for keywords such as "please assign, can i work on this.."

Screenshots / Recordings

N/A

Checklist:

  • [x ] No hard coding: I have used resources from constants.dart without hard coding any value.
  • [ x] No end of file edits: No modifications done at end of resource files.
  • [ x] Code reformatting: I have reformatted code and fixed indentation in every file included in this pull request.
  • [ x] Code analyzation: My code passes analyzations run in flutter analyze and tests run in flutter test.

Summary by Sourcery

CI:

  • Add a GitHub Actions workflow (.github/workflows/auto-reply.yml) that detects assignment requests via regex in issue comments and posts a standard auto-reply

Copy link
Contributor

sourcery-ai bot commented Sep 4, 2025

Reviewer's Guide

This PR adds a new GitHub Actions workflow that listens for assignment-request comments and automatically posts a standardized reply to streamline moderator workload.

File-Level Changes

Change Details Files
Add GitHub Actions workflow for auto-replying to assignment requests
  • Configure workflow to trigger on new issue comments
  • Grant write permission on issues for posting responses
  • Include checkout and github-script steps
  • Implement regex to detect various assignment request phrases
  • Skip processing comments made by bots
  • Post a standard reply when a match is found
.github/workflows/auto-reply.yml

Assessment against linked issues

Issue Objective Addressed Explanation
#1363 Implement an automatic response mechanism for issue comments that contain assignment request keywords or patterns.
#1363 Ensure the auto-reply message matches the specified standard response regarding assignment requests.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments

### Comment 1
<location> `.github/workflows/auto-reply.yml:22` </location>
<code_context>
+        with:
+          script: |
+            const comment = context.payload.comment.body.toLowerCase();
+            const author = context.payload.comment.user.login;
+
+            // Skip bot comments (including this workflow)
+            if (author.endsWith("[bot]")) {
+              return;
+            }
</code_context>

<issue_to_address>
The bot detection logic may miss some bot accounts that do not end with '[bot]'.

Consider checking the 'type' field in the user object for more accurate bot detection, as naming conventions may vary.
</issue_to_address>

<suggested_fix>
<<<<<<< SEARCH
            const comment = context.payload.comment.body.toLowerCase();
            const author = context.payload.comment.user.login;

            // Skip bot comments (including this workflow)
            if (author.endsWith("[bot]")) {
              return;
            }
=======
            const comment = context.payload.comment.body.toLowerCase();
            const author = context.payload.comment.user.login;
            const userType = context.payload.comment.user.type;

            // Skip bot comments (including this workflow)
            if (author.endsWith("[bot]") || userType === "Bot") {
              return;
            }
>>>>>>> REPLACE

</suggested_fix>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Copy link
Contributor

Build Status

Build successful. APKs to test: https://github.com/fossasia/badgemagic-app/actions/runs/17470796332/artifacts/3986243137.

Screenshots

Android Screenshots
iPhone Screenshots
iPad Screenshots

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add auto-reply feature to respond to specific issue comments
1 participant