Skip to content

GitHub Action that lets you holla at your boy (comment on PRs with code comments)

Notifications You must be signed in to change notification settings

haxybaxy/holla-at-your-boy

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

51 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

A GitHub Action that automatically creates PR comments to tag users when you leave special callouts in your code. Perfect for code reviews, getting attention on specific lines, or just letting your teammates know that you're working.

If all of this sounds confusing, check out this example right here!

image

✨ Features

  • 🎯 Customizable prefix - Use any trigger phrase you want (default: !holla )
  • πŸš€ Multi-language support - Works with any programming language's comment syntax
  • πŸ”„ Smart duplicate prevention - Won't spam the same comment twice
  • πŸ‘₯ Multiple user mentions - Tag multiple people in one comment
  • πŸ“ Flexible positioning - Prefix can appear anywhere in the line
  • πŸ› Debug logging - See exactly what's happening

πŸ—ΊοΈ Upcoming Features?

  • 🧹 Auto-clean Comments - When a conversation is resolved or when the PR is merged, the action could make a new commit erasing the line
  • πŸ€” Think of Rebranding - Perhaps a gender neutral or more formal name could be picked for this action, but nothing speaks to me like the current one

πŸš€ Quick Start

1. Add the workflow to your repository

Create .github/workflows/pr-comment.yml:

name: PR Comment Scanner

on:
  pull_request:
    types: [opened, edited, synchronize]

jobs:
  scan-comments:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: write
    steps:      
      - name: Run PR Comment Scanner
        uses: haxybaxy/holla-at-your-boy@v1.6
        with:
          comment-prefix: "!holla "  # Optional: customize your trigger

Note: The permissions section is required to allow the action to create PR comments.

2. Add comments to your code

// TODO: optimize this function !holla @john please review this
function slowFunction() {
  // !holla @sarah @mike can you both check this logic?
  return heavyComputation();
}

/* 
 * Complex algorithm here
 * !holla everyone this needs attention
 */

3. (Optional) Set up user aliases

Create a usermap.json file in your repository root to use friendly names:

{
  "users": {
    "John": "john-github-username",
    "Sarah": "sarah-username",
    "Mike": "mike-dev"
  }
}

Now you can use @John, @john, or @JOHN in your comments - they'll all map to @john-github-username.

4. Create a Pull Request

When you create or update a PR, the action will automatically:

  • Scan all changed files for your prefix
  • Create PR comments tagging the mentioned users
  • Skip duplicate comments to avoid spam

πŸŽ›οΈ Configuration

Inputs

Input Description Required Default
comment-prefix Custom prefix to trigger comments ❌ "!holla "

Example Configurations

Classic GitHub mentions:

jobs:
  scan-comments:
    permissions:
      contents: read
      pull-requests: write
    steps:
      - uses: haxybaxy/holla-at-your-boy@v1.6 # default prefix is "!holla "

Custom team tag:

jobs:
  scan-comments:
    permissions:
      contents: read
      pull-requests: write
    steps:
      - uses: haxybaxy/holla-at-your-boy@v1.6
        with:
          comment-prefix: "!review "

πŸ’‘ Usage Examples

JavaScript/TypeScript

// !holla @frontend-team review this component
const MyComponent = () => {
  // !holla @john optimize this loop
  return data.map(item => <Item key={item.id} />);
};

Python

# !holla @data-team validate this algorithm
def calculate_metrics(data):
    # !holla @alice @bob performance issue here
    return expensive_calculation(data)

CSS/SCSS

/* !holla @design-team check these styles */
.button {
  /* !holla @sarah accessibility concern */
  background: #ff0000;
}

SQL

-- !holla @database-team optimize this query
SELECT * FROM users 
WHERE created_at > NOW() - INTERVAL 30 DAY;
-- !holla @mike index needed here?

Any Language

# Shell script
# !holla @devops-team security review needed

<!-- HTML -->
<!-- !holla @frontend please test in IE -->

// Go
// !holla @backend-team memory leak potential

/* C++ */
/* !holla @performance-team bottleneck identified */

πŸ” How It Works

  1. Triggers: Action runs on PR open, edit, or sync
  2. Scanning: Only scans files changed in the PR
  3. Pattern Matching: Looks for your prefix anywhere in any line
  4. Comment Creation: Creates PR comments with the text after your prefix
  5. Duplicate Prevention: Tracks existing comments to avoid spam

What gets detected:

The body of the message is always what comes after the prefix, but the prefix will still get detected if its not at the start of your message

// βœ… This works: !holla @john check this out
// βœ… Also works: TODO optimize !holla @team performance issue

Comment output:

  • !holla @john check this β†’ PR comment: @john check this
  • !holla everyone review β†’ PR comment: everyone review
  • !holla @team @lead urgent β†’ PR comment: @team @lead urgent

Alias support for mentions

You can use aliases in comments by mentioning @Firstname. These will automatically be mapped to the correct GitHub username based on the usermap.json file. For example, @Alice becomes @alice-username.

πŸ› Troubleshooting

No comments appearing?

  1. Check the Action logs for debug output:

    πŸ”§ Using comment prefix: "!holla "
    πŸ“ Found 3 changed files in PR: ['src/main.js', 'README.md']
    🎯 Found match on line 12: "// !holla @john please review"
    βœ… Creating new PR comment
    
  2. Verify your prefix matches exactly (including spaces)

  3. Ensure files are in the PR - only changed files are scanned

  4. Check workflow permissions - make sure you've added the permissions section to your workflow, to avoid the 'Resource not accessible' by integration error

"Resource not accessible by integration" error?

This error occurs when the GitHub token lacks proper permissions:

  1. Add permissions to your workflow:

    permissions:
      contents: read
      pull-requests: write
  2. For repository owners: Go to Settings β†’ Actions β†’ General β†’ "Workflow permissions" β†’ Select "Read and write permissions"

Pull requests from forks not working?

This is a GitHub security limitation - PRs from forks have read-only access by default:

Option 1: Use pull_request_target (⚠️ Security Risk)

on:
  pull_request_target:  # Instead of pull_request
    types: [opened, edited, synchronize]

Warning: This gives the action write access to your repo. Only use if you trust contributors.

Option 2: Manual approval workflow

  • Keep pull_request trigger
  • Comments will work for PRs from the same repository
  • Fork PRs will need manual approval or different handling

Comments not showing for some users?

  • GitHub notifications depend on user settings
  • Users must have access to the repository
  • Check if usernames are spelled correctly

Duplicate comments?

  • The action tracks duplicates by file + line + content
  • If content changes, it will create a new comment
  • This is intentional to show updates

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run npm run build to update the dist folder
  5. Create a Pull Request

πŸ“ License

MIT License - feel free to use this in your projects!

πŸŽ‰ Credits

Built with ❀️ for better code collaboration. Originally created to make code reviews more social and fun!

❓FAQ

What does Holla at your boy mean?

According to the Urban Dictionary:

"To holla at your boy would be to exchange words or converse with said boy."

According to Mr. GPT:

The phrase "holla at your boy" is a slang expression that basically means "get in touch with me" or "let me know what's up."

"Holla" is slang for "holler," meaning to call out or communicate.

"Your boy" is a casual way for someone to refer to themselves, like saying "me" or "your friend."

So if someone says, "Holla at your boy," they’re telling you to reach outβ€”could be to hang out, talk, or let them know something.

About

GitHub Action that lets you holla at your boy (comment on PRs with code comments)

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •