summaryrefslogtreecommitdiff
path: root/.github/workflows/new-pr-comment.yml
blob: 36ea19098e8da7da692177587859178011b4078e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: "New MR welcome comment"

on:
  pull_request_target:
    types:
      - opened

jobs:
  comment:
    if: >
      github.event.pull_request.user.login != 'vaxerski' &&
      github.event.pull_request.user.login != 'fufexan' &&
      github.event.pull_request.user.login != 'gulafaran' &&
      github.event.pull_request.user.login != 'ujint34' &&
      github.event.pull_request.user.login != 'paideiadilemma' &&
      github.event.pull_request.user.login != 'notashelf'
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write

    env:
      PR_COMMENT: |
        Hello and thank you for making a PR to Hyprland!

        Please check the [PR Guidelines](https://wiki.hypr.land/Contributing-and-Debugging/PR-Guidelines/) and make sure your PR follows them.
        It will make the entire review process faster. :)

        If your code can be tested, please always add tests. See more [here](https://wiki.hypr.land/Contributing-and-Debugging/Tests/).

        _beep boop, I'm just a bot. A real human will review your PR soon._

    steps:
      - name: Add comment to PR
        uses: actions/github-script@v7
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          script: |
            const pr = context.payload.pull_request;

            await github.rest.issues.createComment({
              owner: context.repo.owner,
              repo: context.repo.repo,
              issue_number: pr.number,
              body: process.env.PR_COMMENT,
            });