@@ -34,38 +34,45 @@ jobs:
3434 git log --pretty=oneline | head -n 10
3535
3636 - name : Set up Python
37+ if : github.event_name == 'pull_request'
3738 uses : actions/setup-python@v5
3839 with :
3940 python-version : 3.11
4041
4142 - name : cache-pip
43+ if : github.event_name == 'pull_request'
4244 uses : actions/cache@v4
4345 with :
4446 path : ~/.cache/pip
4547 key : ${{ runner.os }}-pip-${{ hashFiles('.github/workflows/compliance.yml') }}
4648
4749 - name : Install python dependencies
50+ if : github.event_name == 'pull_request'
4851 run : |
4952 pip3 install setuptools
5053 pip3 install wheel
5154 pip3 install -r scripts/requirements-compliance.txt
5255 pip3 install west
5356
5457 - name : west setup
58+ if : github.event_name == 'pull_request'
59+ env :
60+ BASE_REF : ${{ github.base_ref }}
5561 run : |
5662 west init -l . || true
5763 west config manifest.group-filter -- +ci,-optional
5864 west update -o=--depth=1 -n 2>&1 1> west.update.log || west update -o=--depth=1 -n 2>&1 1> west.update2.log
5965
6066 - name : Check for PR description
61- if : ${{ github.event.pull_request.body == '' }}
67+ if : ${{ github.event.pull_request.body == '' }} && github.event_name == 'pull_request'
6268 continue-on-error : true
6369 id : pr_description
6470 run : |
6571 echo "Pull request description cannot be empty."
6672 exit 1
6773
6874 - name : Run Compliance Tests
75+ if : github.event_name == 'pull_request'
6976 continue-on-error : true
7077 id : compliance
7178 env :
@@ -81,13 +88,15 @@ jobs:
8188 -c origin/${BASE_REF}..
8289
8390 - name : upload-results
91+ if : github.event_name == 'pull_request'
8492 uses : actions/upload-artifact@v4
8593 continue-on-error : true
8694 with :
8795 name : compliance.xml
8896 path : compliance.xml
8997
9098 - name : check-warns
99+ if : github.event_name == 'pull_request'
91100 run : |
92101 if [[ ! -s "compliance.xml" ]]; then
93102 exit 1;
0 commit comments