Skip to content

Commit e23b7cc

Browse files
test
1 parent f120c88 commit e23b7cc

File tree

2 files changed

+33
-21
lines changed

2 files changed

+33
-21
lines changed

.github/actions/build/action.yml

+12-12
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ description: >
55
and uploads it to the Github registry
66
77
inputs:
8-
# python_version:
9-
# required: true
8+
python_version:
9+
required: true
1010
SA_GH_USER_NAME:
1111
required: true
1212
SA_GH_USER_EMAIL:
@@ -43,7 +43,7 @@ runs:
4343
- name: Setup python
4444
uses: actions/setup-python@v4
4545
with:
46-
python-version: '3.7'
46+
python-version: ${{ inputs.python_version }}
4747

4848
- name: Create requirements file for pip
4949
shell: bash
@@ -114,20 +114,20 @@ runs:
114114
PrNumber: ${{ github.event.number }}
115115

116116
- name: Download THIRDPARTY
117-
if: '3.7' == '3.7' && github.event_name != 'pull_request' && github.event_name != 'schedule'
117+
if: ${{ inputs.python_version }} == '3.7' && github.event_name != 'pull_request' && github.event_name != 'schedule'
118118
uses: actions/download-artifact@v3
119119
with:
120120
name: THIRDPARTY
121121

122122
- name: Download THIRDPARTY (Optional for PR and schedule)
123-
if: '3.7' == '3.7' && github.event_name == 'pull_request' || github.event_name == 'schedule'
123+
if: ${{ inputs.python_version }} == '3.7' && github.event_name == 'pull_request' || github.event_name == 'schedule'
124124
continue-on-error: true
125125
uses: actions/download-artifact@v3
126126
with:
127127
name: THIRDPARTY
128128

129129
- name: Update Notices
130-
if: '3.7' == '3.7'
130+
if: ${{ inputs.python_version }} == '3.7'
131131
shell: bash
132132
run: |
133133
cp -f THIRDPARTY package/THIRDPARTY || echo "THIRDPARTY file not found (allowed for PR and schedule)"
@@ -139,7 +139,7 @@ runs:
139139
version: ${{ steps.BuildVersion.outputs.VERSION }}
140140

141141
- name: Slim Package
142-
if: always() && '3.7' == '3.7'
142+
if: always() && ${{ inputs.python_version }} == '3.7'
143143
id: slim
144144
uses: splunk/addonfactory-packaging-toolkit-action@v1
145145
with:
@@ -148,26 +148,26 @@ runs:
148148
- name: debug
149149
shell: bash
150150
run: |
151-
echo "'3.7'"
151+
echo "${{ inputs.python_version }}"
152152
echo "${{ inputs.ucc_modinput_functional }}"
153153
echo "${{ github.event_name }}"
154154
155155
- name: Artifact OpenAPI
156-
if: '3.7' == '3.7' && ${{ !cancelled() && inputs.ucc_modinput_functional == 'true' && inputs.modinput_functional == 'true' }}
156+
if: ${{ inputs.python_version }} == '3.7' && ${{ !cancelled() && inputs.ucc_modinput_functional == 'true' && inputs.modinput_functional == 'true' }}
157157
uses: actions/upload-artifact@v3
158158
with:
159159
name: artifact-openapi
160160
path: ${{ github.workspace }}/${{ steps.uccgen.outputs.OUTPUT }}/static/openapi.json
161161

162162
- name: Artifact Splunkbase
163-
if: ${{ !cancelled() }} && '3.7' == '3.7'
163+
if: ${{ !cancelled() }} && ${{ inputs.python_version }} == '3.7'
164164
uses: actions/upload-artifact@v3
165165
with:
166166
name: package-splunkbase
167167
path: ${{ steps.slim.outputs.OUTPUT }}
168168

169169
- name: Upload build to S3
170-
if: '3.7' == '3.7'
170+
if: ${{ inputs.python_version }} == '3.7'
171171
id: buildupload
172172
shell: bash
173173
env:
@@ -180,7 +180,7 @@ runs:
180180
aws s3 cp "${{ steps.slim.outputs.OUTPUT }}" s3://ta-production-artifacts/ta-apps/
181181
182182
- name: Artifact Splunk parts
183-
if: ${{ !cancelled() }} && '3.7' == '3.7'
183+
if: ${{ !cancelled() }} && ${{ inputs.python_version }} == '3.7'
184184
uses: actions/upload-artifact@v3
185185
with:
186186
name: package-deployment

.github/workflows/reusable-build-test-release.yml

+21-9
Original file line numberDiff line numberDiff line change
@@ -306,42 +306,54 @@ jobs:
306306
runs-on: ubuntu-latest
307307
needs:
308308
- setup-workflow
309+
- get-called-ref
309310
if: ${{ needs.setup-workflow.outputs.skip-workflow != 'Yes' }}
310311
steps:
311-
- name: Run compliance copyrights
312-
uses: ./.github/actions/compliance-copyrights
312+
- uses: jenseng/dynamic-uses@v1
313+
with:
314+
uses: splunk/addonfactory-workflow-addon-release/.github/actions/compliance-copyrights@${{ needs.get-called-ref.outputs.ref }}
313315

314316
lint:
315317
name: Lint
316318
runs-on: ubuntu-latest
317319
needs:
318320
- setup-workflow
321+
- get-called-ref
319322
if: ${{ needs.setup-workflow.outputs.skip-workflow != 'Yes' }}
320323
steps:
321-
- name: Run linting checks
322-
uses: ./.github/actions/lint
324+
- uses: jenseng/dynamic-uses@v1
325+
with:
326+
uses: splunk/addonfactory-workflow-addon-release/.github/actions/lint@${{ needs.get-called-ref.outputs.ref }}
323327

324328
review-secrets:
325329
name: Review secrets
326330
runs-on: ubuntu-latest
327331
needs:
328332
- setup-workflow
333+
- get-called-ref
329334
if: ${{ needs.setup-workflow.outputs.skip-workflow != 'Yes' }}
330335
steps:
331-
- name: Run secrets review
332-
uses: ./.github/actions/review-secrets
336+
- uses: jenseng/dynamic-uses@v1
337+
with:
338+
uses: splunk/addonfactory-workflow-addon-release/.github/actions/review-secrets@${{ needs.get-called-ref.outputs.ref }}
333339

334340
semgrep:
335341
name: Semgrep security check
336342
runs-on: ubuntu-latest
343+
# inputs to `dynamic-uses` step
344+
env:
345+
SEMGREP_PUBLISH_TOKEN: ${{ secrets.SEMGREP_PUBLISH_TOKEN }}
337346
needs:
338347
- setup-workflow
348+
- get-called-ref
339349
if: ${{ needs.setup-workflow.outputs.skip-workflow != 'Yes' }}
340350
steps:
341-
- name: Run semgrep
342-
uses: ./.github/actions/semgrep
351+
- uses: jenseng/dynamic-uses@v1
343352
with:
344-
SEMGREP_PUBLISH_TOKEN: ${{ secrets.SEMGREP_PUBLISH_TOKEN }}
353+
uses: splunk/addonfactory-workflow-addon-release/.github/actions/semgrep@${{ needs.get-called-ref.outputs.ref }}
354+
# inputs need to provided as a valid JSON string
355+
with:
356+
${{ toJSON(env) }}
345357

346358
test-inventory:
347359
name: Test inventory

0 commit comments

Comments
 (0)