Skip to content

Commit 8d67982

Browse files
Merge branch 'main' into df/#80-update-basic-dependencies
# Conflicts: # poetry.lock
2 parents c61d08d + af46cf0 commit 8d67982

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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/python-project'
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 Pre-Release
20+
run: |
21+
NEW="${{ steps.metadata.outputs.new-version }}"
22+
if [[ "$NEW" =~ ([0-9]+!)?[0-9]+(\.[0-9]+)*((a|b|rc)[0-9]*|\.dev[0-9]*) ]]; then
23+
echo "::error::Pre-release version ($NEW) detected – workflow stopped."
24+
exit 1
25+
fi
26+
27+
- name: Approve the PR
28+
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
29+
run: gh pr review --approve "$PR_URL"
30+
env:
31+
PR_URL: ${{github.event.pull_request.html_url}}
32+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
33+
34+
- name: Enable auto-merge for Dependabot PRs
35+
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
36+
run: gh pr merge --auto --merge "$PR_URL"
37+
env:
38+
PR_URL: ${{ github.event.pull_request.html_url }}
39+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)