Skip to content

Commit fbc8fc1

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

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.github/workflows/compliance.yml

Lines changed: 8 additions & 0 deletions
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,6 +59,7 @@ 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
62+
if: github.event_name == 'pull_request'
5863
if: ${{ github.event.pull_request.body == '' }}
5964
continue-on-error: true
6065
id: pr_description
@@ -63,6 +68,7 @@ jobs:
6368
exit 1
6469
6570
- name: Run Compliance Tests
71+
if: github.event_name == 'pull_request'
6672
continue-on-error: true
6773
id: compliance
6874
env:
@@ -78,13 +84,15 @@ jobs:
7884
-c origin/${BASE_REF}..
7985
8086
- name: upload-results
87+
if: github.event_name == 'pull_request'
8188
uses: actions/upload-artifact@v4
8289
continue-on-error: true
8390
with:
8491
name: compliance.xml
8592
path: compliance.xml
8693

8794
- name: check-warns
95+
if: github.event_name == 'pull_request'
8896
run: |
8997
if [[ ! -s "compliance.xml" ]]; then
9098
exit 1;

0 commit comments

Comments
 (0)