Skip to content

Commit c748920

Browse files
automation (#8)
1 parent 0c2d0c5 commit c748920

File tree

3 files changed

+51
-1
lines changed

3 files changed

+51
-1
lines changed

.github/CODEOWNERS

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Reviewers for Dependabot PRs (Dependencies)
2+
pyproject.toml @sebastian-peter
3+
poetry.lock @sebastian-peter
4+
5+
# Sourcecode Reviewers
6+
/src @sebastian-peter
7+
/tests @sebastian-peter
8+
9+
# Reviewers for CI/CD related PRs
10+
.github/workflows/ @sebastian-peter @PhilippSchmelter
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Dependabot auto-merge
2+
on: pull_request
3+
4+
permissions:
5+
contents: write
6+
pull-requests: write
7+
8+
jobs:
9+
dependabot:
10+
runs-on: ubuntu-latest
11+
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'ie3-institute/simonaMarkovLoad'
12+
steps:
13+
- name: Dependabot metadata
14+
id: metadata
15+
uses: dependabot/fetch-metadata@d7267f607e9d3fb96fc2fbe83e0af444713e90b7
16+
with:
17+
github-token: "${{ secrets.GITHUB_TOKEN }}"
18+
19+
- name: Check Snapshot
20+
if: contains(steps.metadata.outputs.new-version, 'snap')
21+
run: |
22+
echo "::error::Snapshot versions are not allowed – workflow stopped."
23+
exit 1
24+
25+
- name: Approve the PR
26+
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
27+
run: gh pr review --approve "$PR_URL"
28+
env:
29+
PR_URL: ${{github.event.pull_request.html_url}}
30+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
31+
32+
- name: Enable auto-merge for Dependabot PRs
33+
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
34+
run: gh pr merge --auto --merge "$PR_URL"
35+
env:
36+
PR_URL: ${{ github.event.pull_request.html_url }}
37+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
### Added
10+
- `CODEOWNERS` file and dependabot automation [#7](https://github.com/ie3-institute/simonaMarkovLoad/issues/7)
11+
912
### Changed
10-
- Compute instantaneous kW from cumulative kWh via 15-minute differencing [#1](https://github.com/ie3-institute/simonaMarkovLoad/issues/1)
13+
- Compute instantaneous kW from cumulative kWh via 15-minute differencing [#1](https://github.com/ie3-institute/simonaMarkovLoad/issues/1)

0 commit comments

Comments
 (0)