DEV Community

Hidayt Rahman
Hidayt Rahman

Posted on

Greet to the new PR and issue creator in Github Action - #1

Github action greeting

Github action is the great tool to automate the manual stuff for your project.

What

The below action will greet to the contributor who will create first Pull Request and also the first issue.

How?

Create a folder .github/workflows in the root folder

create a new workflow called greeting.yml inside the .github/workflows/ directory.

Copy the below code and paste in the greeting.yml

name: Greetings

on: [pull_request_target, issues]

jobs:
  greetings:
    runs-on: ubuntu-latest
    permissions:
      issue: write
      pull-requests: write
    steps:
      - uses: actions/first-interaction@v1
        with:
          repo-token: ${{secrets.GITHUB_TOKEN}}
          issue-message: "We appreciate you pointing us to the problem, and as soon as time allows, we will look into it. Thank you!"
          pr-message: "We appreciate you creating your first pull request and look forward to reviewing your future contributions."
Enter fullscreen mode Exit fullscreen mode

Push the file in the main branch and try to create a first issue and first Pull request.

This will send a greeting message in the comment of the PR and issue.

Happy Automation!

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more