Skip to content

Commit cb87074

Browse files
committed
Configure Dependabot and safe package auto-merge
1 parent afc363b commit cb87074

4 files changed

Lines changed: 397 additions & 286 deletions

File tree

.github/dependabot.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
open-pull-requests-limit: 5
8+
groups:
9+
root-dependencies:
10+
update-types:
11+
- minor
12+
- patch
13+
14+
- package-ecosystem: npm
15+
directory: /Frontend/salt-frontend
16+
schedule:
17+
interval: weekly
18+
open-pull-requests-limit: 10
19+
groups:
20+
frontend-dependencies:
21+
update-types:
22+
- minor
23+
- patch
24+
25+
- package-ecosystem: nuget
26+
directory: /Backend
27+
schedule:
28+
interval: weekly
29+
open-pull-requests-limit: 5
30+
groups:
31+
backend-dependencies:
32+
update-types:
33+
- minor
34+
- patch

.github/workflows/ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
frontend:
13+
name: Frontend build
14+
runs-on: ubuntu-latest
15+
defaults:
16+
run:
17+
working-directory: Frontend/salt-frontend
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: 22
23+
cache: npm
24+
cache-dependency-path: Frontend/salt-frontend/package-lock.json
25+
- run: npm ci
26+
- run: npm run build
27+
28+
backend:
29+
name: Backend build
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v4
33+
- uses: actions/setup-dotnet@v4
34+
with:
35+
dotnet-version: 8.x
36+
- run: dotnet restore Backend/SaltTask.fsproj
37+
- run: dotnet build Backend/SaltTask.fsproj --configuration Release --no-restore
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Dependabot auto-merge
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, synchronize, reopened]
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
automerge:
13+
name: Auto-merge safe dependency updates
14+
if: github.event.pull_request.user.login == 'dependabot[bot]'
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Wait for CI checks
18+
env:
19+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
PR_URL: ${{ github.event.pull_request.html_url }}
21+
run: gh pr checks "$PR_URL" --watch --fail-fast
22+
23+
- uses: dependabot/fetch-metadata@v2
24+
id: metadata
25+
with:
26+
github-token: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- name: Enable auto-merge for patch and minor updates
29+
if: >-
30+
steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
31+
steps.metadata.outputs.update-type == 'version-update:semver-minor'
32+
env:
33+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
PR_URL: ${{ github.event.pull_request.html_url }}
35+
run: gh pr merge --auto --squash "$PR_URL"

0 commit comments

Comments
 (0)