Skip to content

Commit 59470e7

Browse files
committed
Add Dependabot Action
1 parent c37f690 commit 59470e7

File tree

3 files changed

+38
-8
lines changed

3 files changed

+38
-8
lines changed

.github/workflows/build_and_test.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ name: Build and Test
33

44
on:
55
push:
6-
branches: [ master ]
6+
branches: [master]
77
pull_request:
8-
branches: [ master ]
8+
branches: [master]
99

1010
jobs:
11-
12-
build:
11+
build_and_test:
1312
name: Build and Test
1413
runs-on: ubuntu-latest
14+
1515
steps:
1616
- name: Checkout repo
1717
uses: actions/checkout@v3

.github/workflows/codeql-analysis.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@
22
# It then automatically uploads the results to GitHub so they can be displayed in the repository's security tab.
33
# https://github.com/github/codeql-action
44

5-
name: "Code Scanning"
5+
name: Code Scanning
66

77
on:
88
push:
9-
branches: [main]
9+
branches: [master]
1010
pull_request:
11-
branches: [main]
11+
branches: [master]
1212

1313
jobs:
14-
CodeQL-Build:
14+
codeql_analysis:
15+
name: Code Scanning
1516
# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest
1617
runs-on: ubuntu-latest
1718

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Merge dependabot updates automatically
2+
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions
3+
4+
name: Dependabot Auto-Merge
5+
on: pull_request
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
dependabot_updates:
13+
name: Dependabot Auto-Merge
14+
runs-on: ubuntu-latest
15+
if: ${{ github.actor == 'dependabot[bot]' }}
16+
17+
steps:
18+
- name: Dependabot metadata
19+
id: metadata
20+
uses: dependabot/[email protected]
21+
with:
22+
github-token: "${{ secrets.GITHUB_TOKEN }}"
23+
24+
- name: Enable auto-merge for Dependabot PRs
25+
if: ${{contains(steps.metadata.outputs.dependency-names, 'my-dependency') && steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
26+
run: gh pr merge --auto --merge "$PR_URL"
27+
env:
28+
PR_URL: ${{github.event.pull_request.html_url}}
29+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)