Skip to content

Commit 51e34f6

Browse files
committed
compliance on pr only
Signed-off-by: Anas Nashif <[email protected]>
1 parent 5ddcf31 commit 51e34f6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

.github/workflows/compliance.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,28 @@ jobs:
1919
fetch-depth: 0
2020

2121
- name: Set up Python
22+
if: github.event_name == 'pull_request'
2223
uses: actions/setup-python@v5
2324
with:
2425
python-version: 3.11
2526

2627
- name: cache-pip
28+
if: github.event_name == 'pull_request'
2729
uses: actions/cache@v4
2830
with:
2931
path: ~/.cache/pip
3032
key: ${{ runner.os }}-pip-${{ hashFiles('.github/workflows/compliance.yml') }}
3133

3234
- name: Install python dependencies
35+
if: github.event_name == 'pull_request'
3336
run: |
3437
pip3 install setuptools
3538
pip3 install wheel
3639
pip3 install python-magic lxml junitparser gitlint pylint pykwalify yamllint clang-format unidiff sphinx-lint ruff
3740
pip3 install west
3841
3942
- name: west setup
43+
if: github.event_name == 'pull_request'
4044
env:
4145
BASE_REF: ${{ github.base_ref }}
4246
run: |
@@ -55,14 +59,15 @@ jobs:
5559
west update -o=--depth=1 -n 2>&1 1> west.update.log || west update -o=--depth=1 -n 2>&1 1> west.update2.log
5660
5761
- name: Check for PR description
58-
if: ${{ github.event.pull_request.body == '' }}
62+
if: ${{ github.event.pull_request.body == '' }} && github.event_name == 'pull_request'
5963
continue-on-error: true
6064
id: pr_description
6165
run: |
6266
echo "Pull request description cannot be empty."
6367
exit 1
6468
6569
- name: Run Compliance Tests
70+
if: github.event_name == 'pull_request'
6671
continue-on-error: true
6772
id: compliance
6873
env:
@@ -78,13 +83,15 @@ jobs:
7883
-c origin/${BASE_REF}..
7984
8085
- name: upload-results
86+
if: github.event_name == 'pull_request'
8187
uses: actions/upload-artifact@v4
8288
continue-on-error: true
8389
with:
8490
name: compliance.xml
8591
path: compliance.xml
8692

8793
- name: check-warns
94+
if: github.event_name == 'pull_request'
8895
run: |
8996
if [[ ! -s "compliance.xml" ]]; then
9097
exit 1;

0 commit comments

Comments
 (0)