Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: Dependabot auto-merge
on:
workflow_run:
workflows: [ "Dependabot auto-approve" ]
types: [ completed ]
name: Dependabot auto-approve
on: pull_request

permissions:
contents: write
Expand All @@ -19,6 +16,19 @@ jobs:
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Check Snapshot
if: contains(steps.metadata.outputs.new-version, 'snap')
run: |
echo "::error::Snapshot versions are not allowed – workflow stopped."
exit 1

- name: Approve the PR
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Enable auto-merge for Dependabot PRs
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
run: gh pr merge --auto --merge "$PR_URL"
Expand Down
29 changes: 0 additions & 29 deletions .github/workflows/dependabot-review.yml

This file was deleted.

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Fixed missing scala sources in releases [#549](https://github.com/ie3-institute/PowerSystemUtils/issues/549)
- Fixed missing if-block in Version-Check [#557](https://github.com/ie3-institute/PowerSystemUtils/issues/557)
- Improved the fix of Version Check [#559](https://github.com/ie3-institute/PowerSystemUtils/issues/559)

## [3.0.0]

Expand Down
5 changes: 1 addition & 4 deletions scripts/version_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,9 @@ semver_gt() {
# Version Checking Logic
if [ "$BASE_BRANCH" = "main" ]; then
echo "'$BRANCH_TYPE' branch into main => applying '$BRANCH_TYPE' rules"
if [ "$PR_VERSION" = "$MAIN_VERSION" ] && [ "$BRANCH_TYPE" = "feature" ]; then
if [[ "$PR_VERSION" == "$MAIN_VERSION" && ( "$BRANCH_TYPE" == "feature" || "$BRANCH_TYPE" == "dependabot" ) ]]; then
echo "OK: PR Version ($PR_VERSION) is identical with the current Main version ($MAIN_VERSION)."
exit 0
elif [ "$BRANCH_TYPE" = "dependabot" ]; then
echo "OK: dependabot-PR – skipping version Check."
exit 0
elif semver_gt "$PR_VERSION" "$MAIN_VERSION" && [ "$BRANCH_TYPE" = "release" ]; then
echo "OK: PR Version ($PR_VERSION) is higher than Main version ($MAIN_VERSION)."
exit 0
Expand Down