Skip to content

[MegaLinter] Apply linters automatic fixes #15

[MegaLinter] Apply linters automatic fixes

[MegaLinter] Apply linters automatic fixes #15

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