Skip to content

Commit b18ae0f

Browse files
authored
feat: change dependabot PR target branch (#35)
1 parent 468fdd3 commit b18ae0f

File tree

4 files changed

+43
-2
lines changed

4 files changed

+43
-2
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ updates:
66
interval: daily
77
time: "08:00"
88
timezone: "America/New_York"
9-
target-branch: "development"
9+
target-branch: "chore/dependabot"
1010
labels: ['dependabot']
1111
open-pull-requests-limit: 10
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: "Dependabot Branch Rebase"
2+
3+
on:
4+
push:
5+
branches:
6+
- development
7+
workflow_dispatch:
8+
9+
jobs:
10+
rebase-branch:
11+
name: "Rebase Development onto Dependabot Branch"
12+
uses: mParticle/mparticle-workflows/.github/workflows/dependabot-rebase-development.yml@stable

.github/workflows/pull-request.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: "Pull Request Checks"
22

3-
on: [ pull_request ]
3+
on: [ pull_request_target ]
44

55
jobs:
66

@@ -9,3 +9,31 @@ jobs:
99
uses: mParticle/mparticle-workflows/.github/workflows/android-sample-app-pull-request.yml@stable
1010
with:
1111
app_relative_path: "core-sdk-samples/higgs-shop-sample-app"
12+
13+
automerge-dependabot:
14+
name: "Automerge Dependabot PR"
15+
needs: [ higgs-shop-sample-app ]
16+
if: ${{ github.actor == 'dependabot[bot]' }}
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.MP_SEMANTIC_RELEASE_BOT }}
19+
GIT_AUTHOR_NAME: mparticle-bot
20+
GIT_AUTHOR_EMAIL: [email protected]
21+
GIT_COMMITTER_NAME: mparticle-bot
22+
GIT_COMMITTER_EMAIL: [email protected]
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: "Rebase Dependabot PR"
26+
uses: actions/github-script@v3
27+
with:
28+
script: |
29+
github.pulls.merge({
30+
owner: context.repo.owner,
31+
repo: context.payload.repository.name,
32+
pull_number: context.payload.pull_request.number,
33+
merge_method: 'rebase'
34+
});
35+
rebase-development:
36+
name: "Rebase Development onto Dependabot Branch"
37+
needs: [ automerge-dependabot ]
38+
if: ${{ github.actor == 'dependabot[bot]' }}
39+
uses: mParticle/mparticle-workflows/.github/workflows/dependabot-rebase-development.yml@stable

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ jobs:
119119
if: ${{ github.event.inputs.dryRun == 'false'}}
120120
run: |
121121
git push origin HEAD:main
122+
git push -f origin HEAD:chore/dependabot
122123
git push origin HEAD:development
123124
- name: "Delete release branch"
124125
if: ${{ github.event.inputs.dryRun == 'false' }}

0 commit comments

Comments
 (0)