|
9 | 9 | pull_request: |
10 | 10 | branches: [main] |
11 | 11 |
|
12 | | -env: # Comment env block if you don't want to apply fixes |
13 | | - # Apply linter fixes configuration |
14 | | - APPLY_FIXES: all # When active, APPLY_FIXES must also be defined as environment variable (in github/workflows/mega-linter.yml or other CI tool) |
15 | | - APPLY_FIXES_EVENT: pull_request # Decide which event triggers application of fixes in a commit or a PR (pull_request, push, all) |
16 | | - APPLY_FIXES_MODE: commit # If APPLY_FIXES is used, defines if the fixes are directly committed (commit) or posted in a PR (pull_request) |
| 12 | +# env: # Comment env block if you don't want to apply fixes |
| 13 | +# # Apply linter fixes configuration |
| 14 | +# APPLY_FIXES: all # When active, APPLY_FIXES must also be defined as environment variable (in github/workflows/mega-linter.yml or other CI tool) |
| 15 | +# APPLY_FIXES_EVENT: pull_request # Decide which event triggers application of fixes in a commit or a PR (pull_request, push, all) |
| 16 | +# APPLY_FIXES_MODE: commit # If APPLY_FIXES is used, defines if the fixes are directly committed (commit) or posted in a PR (pull_request) |
17 | 17 |
|
18 | 18 | concurrency: |
19 | 19 | group: ${{ github.ref }}-${{ github.workflow }} |
@@ -49,31 +49,31 @@ jobs: |
49 | 49 | VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} # Validates all source when push on main, else just the git diff with main. Override with true if you always want to lint all sources |
50 | 50 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
51 | 51 |
|
52 | | - # Create pull request if applicable (for now works only on PR from same repository, not from forks) |
53 | | - - name: Create Pull Request with applied fixes |
54 | | - id: cpr |
55 | | - if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix') |
56 | | - uses: peter-evans/create-pull-request@v6 |
57 | | - with: |
58 | | - token: ${{ secrets.GITHUB_TOKEN }} |
59 | | - commit-message: "[MegaLinter] Apply linters automatic fixes" |
60 | | - title: "[MegaLinter] Apply linters automatic fixes" |
61 | | - labels: bot |
62 | | - - name: Create PR output |
63 | | - if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix') |
64 | | - run: | |
65 | | - echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" |
66 | | - echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" |
| 52 | + # # Create pull request if applicable (for now works only on PR from same repository, not from forks) |
| 53 | + # - name: Create Pull Request with applied fixes |
| 54 | + # id: cpr |
| 55 | + # if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix') |
| 56 | + # uses: peter-evans/create-pull-request@v6 |
| 57 | + # with: |
| 58 | + # token: ${{ secrets.GITHUB_TOKEN }} |
| 59 | + # commit-message: "[MegaLinter] Apply linters automatic fixes" |
| 60 | + # title: "[MegaLinter] Apply linters automatic fixes" |
| 61 | + # labels: bot |
| 62 | + # - name: Create PR output |
| 63 | + # if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix') |
| 64 | + # run: | |
| 65 | + # echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" |
| 66 | + # echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" |
67 | 67 |
|
68 | | - # Push new commit if applicable (for now works only on PR from same repository, not from forks) |
69 | | - - name: Prepare commit |
70 | | - if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix') |
71 | | - run: sudo chown -Rc $UID .git/ |
72 | | - - name: Commit and push applied linter fixes |
73 | | - if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix') |
74 | | - uses: stefanzweifel/git-auto-commit-action@v4 |
75 | | - with: |
76 | | - branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }} |
77 | | - commit_message: "[MegaLinter] Apply linters fixes" |
78 | | - commit_user_name: megalinter-bot |
79 | | - commit_user_email: [email protected] |
| 68 | + # # Push new commit if applicable (for now works only on PR from same repository, not from forks) |
| 69 | + # - name: Prepare commit |
| 70 | + # if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix') |
| 71 | + # run: sudo chown -Rc $UID .git/ |
| 72 | + # - name: Commit and push applied linter fixes |
| 73 | + # if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix') |
| 74 | + # uses: stefanzweifel/git-auto-commit-action@v4 |
| 75 | + # with: |
| 76 | + # branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }} |
| 77 | + # commit_message: "[MegaLinter] Apply linters fixes" |
| 78 | + # commit_user_name: megalinter-bot |
| 79 | + # commit_user_email: [email protected] |
0 commit comments