diff --git a/.github/workflows/autoupdate-fork.yml b/.github/workflows/autoupdate-fork.yml index f06bb8fd..745eac26 100644 --- a/.github/workflows/autoupdate-fork.yml +++ b/.github/workflows/autoupdate-fork.yml @@ -17,7 +17,8 @@ jobs: autoupdate-pr: if: > startsWith(github.repository, 'asyncapi/') && - github.event_name == 'issue_comment' && ( + github.event.issue.pull_request && + github.event.issue.state != 'closed' && ( contains(github.event.comment.body, '/update') || contains(github.event.comment.body, '/u') ) @@ -83,8 +84,7 @@ jobs: ) { // Add comment to PR if the bot doesn't have permissions to update the PR - const comment = `@${context.actor} I don't have permissions to update this PR. Please ask the PR author to check the "Allow edits from maintainers" checkbox in the PR settings.`; - + const comment = `@${context.actor} I don't have permissions to update this PR. Please ask the PR author to check the "Allow edits from maintainers" checkbox in the PR settings. Another possible reason for failure can due to the fork being in an organisation and not under a user.`; await github.rest.issues.createComment({ owner: context.repo.owner, repo: context.repo.repo, diff --git a/.github/workflows/help-command.yml b/.github/workflows/help-command.yml index 303e0e16..8aac8747 100644 --- a/.github/workflows/help-command.yml +++ b/.github/workflows/help-command.yml @@ -33,8 +33,8 @@ 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. (Currently only works for upstream branches.)` - - \`/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.` + - \`/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. (Currently only works for upstream branches.) + - \`/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. NOTE: this only updates the PR once, so if you need to update again, you need to call the command again.` }) create_help_comment_issue: