From 0b973c9d821e3179b4941d5014964603bf7449e7 Mon Sep 17 00:00:00 2001 From: Jacob Herrington Date: Fri, 3 Jul 2020 10:49:40 -0500 Subject: [PATCH] Allow organization owners to use the Automatic Rebase workflow (#9090) * Allow org owners to kick off automatic rebase I suspect without this change PBJ couldn't kick off the automatic rebase workflow. This also includes a tweak to our method for determining if this is a comment on a PR. I personally think this method is more explicit and therefore readable. * Add explanatory comment to rebase workflow This might help someone determine what the workflow does at a glance, it also documents a slightly unexpected caveat: The workflow can't be triggered if your organization membership is private. * Trigger Travis Co-authored-by: rhymes --- .github/workflows/rebase.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rebase.yml b/.github/workflows/rebase.yml index a08708af1..eec2d8a78 100644 --- a/.github/workflows/rebase.yml +++ b/.github/workflows/rebase.yml @@ -1,4 +1,9 @@ -# https://github.com/marketplace/actions/automatic-rebase (https://github.com/cirrus-actions/rebase) +# This workflow allows an organization member or owner to kickoff an automated +# rebase by commenting on a pull request with "/rebase". In order for the +# workflow to run, organization membership must be set to public! + +# https://github.com/marketplace/actions/automatic-rebase (https://github.com/cirrus-actions/rebase) + on: issue_comment: types: [created] @@ -6,7 +11,10 @@ name: Automatic Rebase jobs: rebase: name: Rebase - if: github.event.issue.pull_request != '' && startsWith(github.event.comment.body, '/rebase') && github.event.comment.author_association == 'MEMBER' + if: contains(github.event.comment.html_url, '/pull/') && + startsWith(github.event.comment.body, '/rebase') && + (github.event.comment.author_association == 'MEMBER' || + github.event.comment.author_association == 'OWNER') runs-on: ubuntu-latest steps: - uses: actions/checkout@master