Skip to content

Commit

Permalink
feat: add comment in events
Browse files Browse the repository at this point in the history
  • Loading branch information
Shurtu-gal committed Nov 21, 2023
1 parent ea2bd49 commit ce809fc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
body: `Hello, @${{ github.actor }}! 👋🏼
This PR is not up to date with the base branch and can't be merged.
Please update your branch manually with the latest version of the base branch.
PRO-TIP: Add a comment to your PR with the text: \`/au\` or \`/autoupdate\` and our bot will take care of updating the branch in the future. The only requirement for this to work is to enable [Allow edits from maintainers](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork) option in your PR.
PRO-TIP: Add a comment to your PR with the text: \`/u\` or \`/update\` and our bot will take care of updating the branch in the future. The only requirement for this to work is to enable [Allow edits from maintainers](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork) option in your PR.
Thanks 😄`
})
}
Expand Down
26 changes: 17 additions & 9 deletions .github/workflows/autoupdate-pr-branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,24 @@ on:
- 'bot/**'
- 'all-contributors/**'

issue_comment:
types: [created]

jobs:
autoupdate-fork:
if: startsWith(github.repository, 'asyncapi/')
if: >
startsWith(github.repository, 'asyncapi/') &&
(
github.event_name == 'push' ||
(
github.event_name == 'issue_comment' &&
github.event.issue.pull_request != null &&
(
contains(github.event.comment.body, '/update') ||
contains(github.event.comment.body, '/u')
)
)
)
runs-on: ubuntu-latest
steps:
- name: Autoupdate PR branches
Expand All @@ -29,11 +44,4 @@ jobs:
pr_filter: 'labelled'
pr_label: 'autoupdate'
merge_fail_action: 'comment'
ignore_conflicts: true







ignore_conflicts: true
1 change: 1 addition & 0 deletions .github/workflows/help-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
- \`/ready-to-merge\` or \`/rtm\` - This comment will trigger automerge of PR in case all required checks are green, approvals in place and do-not-merge label is not added
- \`/do-not-merge\` or \`/dnm\` - This comment will block automerging even if all conditions are met and ready-to-merge label is added
- \`/autoupdate\` or \`/au\` - This comment will add \`autoupdate\` label to the PR and keeps your PR up-to-date to the target branch's future changes. Unless there is a merge conflict or it is a draft PR.`
- \`/update\` or \`/u\` - This comment will update the PR with the latest changes from the target branch. Unless there is a merge conflict or it is a draft PR.`
})

create_help_comment_issue:
Expand Down

0 comments on commit ce809fc

Please sign in to comment.