Skip to content

Commit 127c773

Browse files
committed
Add the possibility to let the action rebase the PR for you
There are some cases where the following happens: 1. You create a PR, action-manifest-pr creates the manifest PR 2. The PR is merged. The action updates the PR. 3. A conflict occurs in the manifest-PR. This commit adds the possibility to add a comment to your PR that will automatically rebase the manifest-PR. This should work even if the PR is closed. Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
1 parent 5b1199c commit 127c773

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

action.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ inputs:
1515
required: false
1616
type: string
1717
default: manifest-pr-skip
18+
rebase-comment-string:
19+
required: false
20+
type: string
21+
default: 'action-manifest-pr please rebase'
1822
manifest-pr-title-details:
1923
required: false
2024
type: string
@@ -166,3 +170,15 @@ runs:
166170
set -e
167171
if (( $has_conflict == 1)) ; then git rebase upstream/main -X theirs ; fi
168172
git push origin auto-manifest-${{ github.event.repository.name }}-${{ github.event.pull_request.number }}:auto-manifest-${{ github.event.repository.name }}-${{ github.event.pull_request.number }} -f
173+
174+
- name: Rebase manifest-PR on comment
175+
if: ${{ github.event.issue.pull_request }} &&
176+
${{ github.event.issue_comment.created }}
177+
contains(github.event.issue_comment.created.comment, inputs.rebase-comment-string)
178+
shell: bash
179+
run: |
180+
git checkout auto-manifest-${{ github.event.repository.name }}-${{ github.event.pull_request.number }}
181+
git remote add upstream https://github.com/${{ inputs.target-repo }}
182+
git fetch upstream
183+
git rebase upstream/main -X theirs
184+
git push origin auto-manifest-${{ github.event.repository.name }}-${{ github.event.pull_request.number }}:auto-manifest-${{ github.event.repository.name }}-${{ github.event.pull_request.number }} -f

0 commit comments

Comments
 (0)