Skip to content

Commit df3e30d

Browse files
committed
e Dependabot
1 parent 359d0f0 commit df3e30d

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

.github/dependabot.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"

.github/workflows/build.yml

+17
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,20 @@ jobs:
7878
uses: actions/checkout@v3
7979
- name: Lint the pod spec
8080
run: pod spec lint --quick
81+
82+
auto-merge:
83+
needs: [ buildSwiftPackage, buildCarthage, podspec ]
84+
runs-on: ubuntu-latest
85+
steps:
86+
- name: Check out repo
87+
uses: actions/checkout@v3
88+
- name: auto-merge
89+
if: |
90+
github.actor == 'dependabot[bot]' &&
91+
github.event_name == 'pull_request'
92+
run: |
93+
./merge_dependabot.sh
94+
env:
95+
PR_URL: ${{github.event.pull_request.html_url}}
96+
# this secret needs to be in the settings.secrets.dependabot
97+
GITHUB_TOKEN: ${{secrets.GH_ACTION_TOKEN}}

merge_dependabot.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
3+
gh pr merge --auto --rebase "$PR_URL"
4+
5+
if [ $? -ne 0 ]
6+
then
7+
echo 'if you want github to automatically merge pull requests from dependabot, you need to create a'
8+
echo 'personal access token (public_repo) and assign it to settings -> secrets -> dependabot -> GH_ACTION_TOKEN'
9+
fi

0 commit comments

Comments
 (0)