Skip to content

Commit

Permalink
Let MegaLinter create PRs instead of commits
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianPfaff committed Sep 28, 2023
1 parent a089dfc commit 69595be
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 9 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env: # Comment env block if you do not want to apply fixes
# Apply linter fixes configuration
APPLY_FIXES: all # When active, APPLY_FIXES must also be defined as environment variable (in github/workflows/mega-linter.yml or other CI tool)
APPLY_FIXES_EVENT: pull_request # Decide which event triggers application of fixes in a commit or a PR (pull_request, push, all)
APPLY_FIXES_MODE: commit # If APPLY_FIXES is used, defines if the fixes are directly committed (commit) or posted in a PR (pull_request)
APPLY_FIXES_MODE: pull_request # If APPLY_FIXES is used, defines if the fixes are directly committed (commit) or posted in a PR (pull_request)

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
Expand All @@ -28,15 +28,18 @@ jobs:
build:
name: MegaLinter
runs-on: ubuntu-latest

permissions:
checks: write
pull-requests: write
# Give the default GITHUB_TOKEN write permission to commit and push, comment issues & post new PR
# Remove the ones you do not need
contents: write

issues: write
pull-requests: write
steps:
- name: Check out repository
- name: Checkout Code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0

- name: Create alpine-wheels folder
run: mkdir alpine-wheels
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/merge_linter_changes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Auto Merge PRs

on:
pull_request:
types:
- opened
- synchronize
- labeled
- unlabeled
- edited

jobs:
auto-merge:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Auto-merge PR if criteria are met
run: |
if [[ "${{ github.event.pull_request.base.ref }}" != "main" && "${{ github.event.pull_request.title }}" == "[MegaLinter]*" ]]; then
echo "Criteria met. Auto-merging the PR."
curl -X PUT "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/merge" \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json"
else
echo "Criteria not met. Not auto-merging."
fi
6 changes: 3 additions & 3 deletions pyrecest/distributions/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from pyrecest.distributions.abstract_bounded_domain_distribution import (
AbstractBoundedDomainDistribution,
)
from pyrecest.distributions.abstract_bounded_nonperiodic_distribution import (
AbstractBoundedNonPeriodicDistribution,
)
from pyrecest.distributions.abstract_bounded_domain_distribution import (
AbstractBoundedDomainDistribution,
)
from pyrecest.distributions.abstract_custom_distribution import (
AbstractCustomDistribution,
)
Expand Down

0 comments on commit 69595be

Please sign in to comment.