Skip to content

Commit ce6373d

Browse files
committed
ci: remote apply changes step of megalinter github action
This should allow megalinter to run, currently non-verified github actions are not allowed Signed-off-by: Alan Wandke <[email protected]>
1 parent 654c38a commit ce6373d

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

.github/workflows/mega-linter.yml

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ on:
99
pull_request:
1010
branches: [main]
1111

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)
1717

1818
concurrency:
1919
group: ${{ github.ref }}-${{ github.workflow }}
@@ -49,31 +49,31 @@ jobs:
4949
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
5050
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5151

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 }}"
6767

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

Comments
 (0)