Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(workflows): add greeting workflow for new issues and PRs. #128

Merged
merged 2 commits into from
Aug 19, 2024

Conversation

K-dash
Copy link
Collaborator

@K-dash K-dash commented Aug 18, 2024

General:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Code:

  1. Does your submission pass tests?
  2. Have you run the linter/formatter on your code locally before submission?
  3. Have you updated the documentation/README to reflect your changes, as applicable?
  4. Have you added an explanation of what your changes do?
  5. Have you written new tests for your changes, as applicable?

Change Summary

@ryansurf
I added a GitHub Actions workflow (greeting.yml) that displays a greeting message for newly opened issues and pull requests!

  • Exclude certain actors (all-contributors[bot] and ryansurf) and automatically send a welcome message for first-time contributors.

  • Include separate messages for issue and pull request to thank external contributors and promote project stars😊

Reference:
https://dev.to/hidaytrahman/greet-to-the-new-pr-and-issue-creator-in-github-action-1-k89
https://github.com/actions/first-interaction

Summary by Sourcery

Add a GitHub Actions workflow to greet new contributors on opening issues or pull requests, with personalized messages for each type of contribution, while excluding specific actors.

New Features:

  • Introduce a GitHub Actions workflow to automatically greet new contributors when they open issues or pull requests.

CI:

  • Add a greeting workflow that triggers on new issues and pull requests, excluding certain actors, and sends a welcome message to first-time contributors.

Copy link
Contributor

sourcery-ai bot commented Aug 18, 2024

Reviewer's Guide by Sourcery

This pull request adds a new GitHub Actions workflow file named 'greeting.yml' to implement a greeting system for new issues and pull requests. The workflow is designed to welcome first-time contributors with personalized messages for both issues and pull requests, encouraging engagement and project growth.

File-Level Changes

Files Changes
.github/workflows/greeting.yml Implemented a new GitHub Actions workflow for greeting new contributors
.github/workflows/greeting.yml Set up conditional execution to exclude specific actors from receiving greetings
.github/workflows/greeting.yml Configured separate welcome messages for issues and pull requests
.github/workflows/greeting.yml Utilized the 'actions/first-interaction' action to identify first-time contributors

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

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 @K-dash - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟡 Security: 1 issue found
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

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 to tell me if it was helpful.

jobs:
greeting:
runs-on: ubuntu-latest
if: ${{ github.actor != 'all-contributors[bot]' && github.actor != 'ryansurf' }}
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion (performance): Consider using a more scalable approach for actor exclusions

The current hardcoded list of excluded actors might become difficult to maintain as it grows. Consider using a separate configuration file or a more dynamic approach for managing excluded users.

Suggested change
if: ${{ github.actor != 'all-contributors[bot]' && github.actor != 'ryansurf' }}
if: ${{ !contains(fromJson('["all-contributors[bot]", "ryansurf"]'), github.actor) }}

name: Greetings

on:
pull_request_target:
Copy link
Contributor

Choose a reason for hiding this comment

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

🚨 issue (security): Be cautious when using 'pull_request_target' event

The 'pull_request_target' event can be a security risk if not handled carefully, as it runs workflows with repository secrets on PRs from forks. Ensure that this workflow doesn't execute any untrusted code from the PR.

.github/workflows/greeting.yml Outdated Show resolved Hide resolved
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
@K-dash K-dash assigned K-dash and ryansurf and unassigned K-dash Aug 18, 2024
@K-dash K-dash requested a review from ryansurf August 18, 2024 14:49
issue-message: |
👋 Hi! Thanks for opening your first issue!
• We're excited to see your contribution.
• If you find this project helpful, please consider giving it a star ⭐
Copy link
Owner

Choose a reason for hiding this comment

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

I like the message!

@ryansurf
Copy link
Owner

@K-dash

I like the idea! The messages are nice and I like asking to consider giving a star to promote the project. Good work!

@ryansurf ryansurf merged commit d2606bc into ryansurf:main Aug 19, 2024
3 checks passed
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.

2 participants