Skip to content

Commit 4a5b42d

Browse files
committed
merge mega-linter job to allow run on job condition
1 parent fa1dcab commit 4a5b42d

File tree

2 files changed

+50
-59
lines changed

2 files changed

+50
-59
lines changed

.github/workflows/mega-linter.yml

Lines changed: 0 additions & 56 deletions
This file was deleted.

.github/workflows/testlistener.yaml

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,60 @@
11
name: TestListener
22

33
on:
4-
push:
5-
branches:
6-
- master
4+
# Trigger mega-linter at every push. Action will also be visible from Pull Requests to master
5+
push: # Comment this line to trigger action only on pull-requests (not recommended if you don't pay for GH Actions)
76
pull_request:
7+
branches: [master]
88

99
jobs:
10+
# Cancel duplicate jobs: https://github.com/fkirc/skip-duplicate-actions#option-3-cancellation-only
11+
cancel_duplicates:
12+
name: Cancel duplicate jobs
13+
runs-on: ubuntu-18.04
14+
steps:
15+
- # Cancellation of previous workflow runs
16+
uses: fkirc/skip-duplicate-actions@master
17+
with:
18+
github_token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
19+
cancel_others: true
20+
21+
lint_files:
22+
name: Mega-Linter
23+
runs-on: ubuntu-18.04
24+
steps:
25+
- # Git Checkout
26+
name: Checkout Code
27+
uses: actions/checkout@v2
28+
with:
29+
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
30+
fetch-depth: 0
31+
32+
- # Install dependencies
33+
name: Install Composer dependencies
34+
uses: "ramsey/composer-install@v1"
35+
with:
36+
dependency-versions: "highest"
37+
composer-options: "--prefer-dist"
38+
39+
- # Mega-Linter
40+
name: Mega-Linter
41+
id: ml
42+
# You can override Mega-Linter flavor used to have faster performances
43+
# More info at https://nvuillam.github.io/mega-linter/flavors/
44+
uses: nvuillam/mega-linter/flavors/php@v4
45+
env:
46+
# All available variables are described in documentation
47+
# https://nvuillam.github.io/mega-linter/configuration/
48+
# Validates all source when push on master, else just the git diff with master. Override with true if you always want to lint all sources
49+
VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
# ADD YOUR CUSTOM ENV VARIABLES HERE OR DEFINE THEM IN A FILE .mega-linter.yml AT THE ROOT OF YOUR REPOSITORY
52+
# DISABLE: COPYPASTE,SPELL # Uncomment to disable copy-paste and spell checks
53+
LOG_LEVEL: "debug"
54+
1055
testlistener:
56+
needs: lint_files
57+
1158
runs-on: ${{ matrix.os }}
1259

1360
strategy:

0 commit comments

Comments
 (0)