Skip to content

Commit

Permalink
fix: only comment welcome message on non-bot user PRs (#24)
Browse files Browse the repository at this point in the history
Currently, the welcome message is commented to every PR, even ones that
were opened by renovate. The message itself does not make sense on PRs
opened by bots and this PR fixes that behavior.

It also fixes a link at the end of the message to the location of the
workflow file that generated the message.
  • Loading branch information
PascalFrenz committed May 19, 2024
1 parent d30f698 commit 35d36b2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/default_welcome_message_callable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:

jobs:
welcome-message:
if: ${{ ! endsWith(github.actor, '[bot]') }}
runs-on: ubuntu-latest
permissions:
pull-requests: write
Expand All @@ -27,6 +28,6 @@ jobs:
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Hey @${{ github.event.pull_request.user.login }}! 👋\n\nThank you for your contribution to the project. Please refer to the [contribution rules](../blob/main/.github/CONTRIBUTING.md) for a quick overview of the process.\n\nMake sure that this PR clearly explains:\n\n- the problem being solved\n- the best way a reviewer and you can test your changes\n\nWith submitting this PR you confirm that you hold the rights of the code added and agree that it will published under this [LICENSE](../blob/main/LICENSE).\n\nThe following ChatOps commands are supported:\n- `/help`: notifies a maintainer to help you out\n\nSimply add a comment with the command in the first line. If you need to pass more information, separate it with a blank line from the command.\n\n_This message was generated automatically. You are welcome to [improve it](https://github.com/Hapag-Lloyd/test/blob/main/.github/workflows/default_welcome_message_callable.yml)._'
body: 'Hey @${{ github.event.pull_request.user.login }}! 👋\n\nThank you for your contribution to the project. Please refer to the [contribution rules](../blob/main/.github/CONTRIBUTING.md) for a quick overview of the process.\n\nMake sure that this PR clearly explains:\n\n- the problem being solved\n- the best way a reviewer and you can test your changes\n\nWith submitting this PR you confirm that you hold the rights of the code added and agree that it will published under this [LICENSE](../blob/main/LICENSE).\n\nThe following ChatOps commands are supported:\n- `/help`: notifies a maintainer to help you out\n\nSimply add a comment with the command in the first line. If you need to pass more information, separate it with a blank line from the command.\n\n_This message was generated automatically. You are welcome to [improve it](https://github.com/Hapag-Lloyd/Workflow-Templates/blob/main/.github/workflows/default_welcome_message_callable.yml)._'
})
# yamllint enable rule:line-length

0 comments on commit 35d36b2

Please sign in to comment.