name: Automatic Rebase on: issue_comment: types: [created] permissions: {} jobs: rebase: name: Rebase if: >- github.repository == 'velero-io/velero' && github.event.issue.pull_request != null && github.event.comment.body == '/rebase' && contains( fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association ) runs-on: ubuntu-latest permissions: # contents: write is required because updating the pull request branch # pushes commits to the head branch. contents: write pull-requests: write steps: - name: Rebase pull request env: GH_TOKEN: ${{ github.token }} GH_REPO: ${{ github.repository }} PR_NUMBER: ${{ github.event.issue.number }} run: gh pr update-branch "$PR_NUMBER" --repo "$GH_REPO" --rebase