@@ -6,15 +6,21 @@ permissions:
66on :
77 workflow_call :
88 inputs :
9- version :
9+ version : # required if skip is false, but allowing default to enable skipping both checks when no code changes
1010 description : ' Version calculated in Build phase'
11- required : true
11+ required : false
1212 type : string
13+ default : ' '
1314 components :
1415 description : ' A JSON string array of components to check'
1516 required : false
1617 type : string
1718 default : ' ["api"]'
19+ skip :
20+ description : ' Exit immediately with success without running any checks (for PRs with no code changes)'
21+ required : false
22+ type : boolean
23+ default : false
1824
1925env :
2026 IMAGE_BASE_NAME : ${{ vars.IMAGE_BASE_NAME || 'fairagro-advanced-middleware' }}
2329jobs :
2430 licence-check :
2531 name : Licence Check
32+ if : ${{ !inputs.skip }}
2633 runs-on : ubuntu-latest
2734 strategy :
2835 matrix :
5360
5461 security-check :
5562 name : Security Check
63+ if : ${{ !inputs.skip }}
5664 runs-on : ubuntu-latest
5765 strategy :
5866 matrix :
@@ -119,21 +127,29 @@ jobs:
119127 contents : read
120128
121129 steps :
130+ - name : No code changes — skipping checks
131+ if : ${{ inputs.skip }}
132+ run : echo "No code files changed. Exiting with success."
133+
122134 - name : Checkout code
135+ if : ${{ !inputs.skip }}
123136 uses : actions/checkout@v4
124137
125138 - name : Download Docker image artifact
139+ if : ${{ !inputs.skip }}
126140 uses : actions/download-artifact@v4
127141 with :
128142 name : docker-image-${{ matrix.component }}-${{ inputs.version }}
129143
130144 - name : Load Docker image
145+ if : ${{ !inputs.skip }}
131146 run : |
132147 docker load < docker-image-${{ matrix.component }}.tar.gz
133148 IMAGE_TAG="local/${{ env.IMAGE_BASE_NAME }}-${{ matrix.component }}:${{ inputs.version }}"
134149 echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV
135150
136151 - name : Run Container Structure Tests
152+ if : ${{ !inputs.skip }}
137153 uses : plexsystems/container-structure-test-action@v0.3.0
138154 with :
139155 image : ${{ env.IMAGE_TAG }}
0 commit comments