Skip to content

Commit 50e4755

Browse files
authored
fix: Changes on pull_request -> pull_request_target (#603)
* changes `on` pull_request -> pull_request_target An attempt to make this workflow approve and merge as expected. * Adds a step to rebase if PR `mergeable_state` is `behind`
1 parent 3ac0803 commit 50e4755

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/dependabot.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
name: Dependabot
16-
on: pull_request
16+
on: pull_request_target
1717

1818
permissions:
1919
contents: write
@@ -27,8 +27,10 @@ jobs:
2727
PR_URL: ${{ github.event.pull_request.html_url }}
2828
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2929
steps:
30+
- name: Rebase if behind
31+
if: github.event.pull_request.mergeable_state == 'behind'
32+
run: gh pr comment --body "@dependabot rebase" "$PR_URL"
3033
- name: approve
3134
run: gh pr review --approve "$PR_URL"
3235
- name: merge
3336
run: gh pr merge --auto --squash --delete-branch "$PR_URL"
34-

0 commit comments

Comments
 (0)