Skip to content

Commit 1b0f375

Browse files
test
1 parent c58a842 commit 1b0f375

File tree

4 files changed

+93
-73
lines changed

4 files changed

+93
-73
lines changed
Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Get called workflow SHA
1+
name: Get called workflow ref
22

33
description: >
44
A workaround to the issue: https://github.com/actions/toolkit/issues/1264.
@@ -12,8 +12,8 @@ inputs:
1212
required: true
1313

1414
outputs:
15-
caller-sha:
16-
value: ${{ steps.workflows-ref.outputs.caller-sha }}
15+
caller-ref:
16+
value: ${{ steps.workflows-ref.outputs.caller-ref }}
1717

1818
runs:
1919
using: composite
@@ -22,8 +22,5 @@ runs:
2222
id: workflows-ref
2323
shell: bash
2424
run: |
25-
sha=$(curl -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ inputs.GH_TOKEN_ADMIN }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/splunk/splunk-add-on-for-microsoft-cloud-services/actions/runs/${{ github.run_id }} | jq -r '.referenced_workflows[0] | .ref')
26-
echo "caller-sha=$sha" >> $GITHUB_OUTPUT
27-
echo $(curl -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ inputs.GH_TOKEN_ADMIN }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/splunk/splunk-add-on-for-microsoft-cloud-services/actions/runs/${{ github.run_id }})
28-
echo "$sha"
29-
echo "$caller-sha"
25+
ref=$(curl -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ inputs.GH_TOKEN_ADMIN }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/splunk/splunk-add-on-for-microsoft-cloud-services/actions/runs/${{ github.run_id }} | jq -r '.referenced_workflows[0] | .ref')
26+
echo "caller-ref=$ref" >> $GITHUB_OUTPUT

.github/actions/build/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,12 @@ runs:
144144
with:
145145
source: ${{ steps.uccgen.outputs.OUTPUT }}
146146

147+
- name: debug
148+
shell: bash
149+
run: |
150+
echo "${{ inputs.python_version }}"
151+
echo "${{ inputs.ucc_modinput_functional }}"
152+
147153
- name: Artifact OpenAPI
148154
if: ${{ inputs.python_version }} == '3.7' && ${{ !cancelled() && inputs.ucc_modinput_functional == 'true' && inputs.modinput_functional == 'true' }}
149155
uses: actions/upload-artifact@v3

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

Lines changed: 45 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -197,53 +197,75 @@ jobs:
197197
echo "$test_type""_labeled: ${EXECUTE_LABELED["$test_type"]}"
198198
done
199199
200+
get-called-ref:
201+
name: Get called ref
202+
runs-on: ubuntu-latest
203+
outputs:
204+
ref: ${{ steps.get-ref.outputs.caller-ref }}
205+
steps:
206+
- id: get-ref
207+
uses: splunk/addonfactory-workflow-addon-release/.github/actions/_called-wf-ref@fix/lightweight-workflow-ADDON-66448
208+
with:
209+
GH_TOKEN_ADMIN: ${{ secrets.GH_TOKEN_ADMIN }}
210+
200211
validate-pr-title:
201212
name: Validate PR title
202213
runs-on: ubuntu-latest
214+
# inputs to `dynamic-uses` step
215+
env:
216+
GITHUB_TOKEN: ${{ github.token }}
203217
needs:
204218
- setup-workflow
219+
- get-called-ref
205220
if: ${{ needs.setup-workflow.outputs.skip-workflow != 'Yes' && github.event_name == 'pull_request' }}
206221
permissions:
207222
contents: read
208223
packages: read
209224
pull-requests: read
210225
statuses: write
211226
steps:
212-
- name: Run title validation
213-
uses: ./.github/actions/validate-pr-title
227+
- uses: jenseng/dynamic-uses@v1
214228
with:
215-
GITHUB_TOKEN: ${{ github.token }}
229+
uses: splunk/addonfactory-workflow-addon-release/.github/actions/validate-pr-title@${{ needs.get-called-ref.outputs.ref }}
230+
# inputs need to provided as a valid JSON string
231+
with: ${{ toJSON(env) }}
216232

217233
meta:
218234
name: Prepare metadata
219235
runs-on: ubuntu-latest
236+
# inputs to `dynamic-uses` step
237+
env:
238+
SA_GH_USER_NAME: ${{ secrets.SA_GH_USER_NAME }}
239+
SA_GH_USER_EMAIL: ${{ secrets.SA_GH_USER_EMAIL }}
240+
SA_GPG_PRIVATE_KEY: ${{ secrets.SA_GPG_PRIVATE_KEY }}
241+
SA_GPG_PASSPHRASE: ${{ secrets.SA_GPG_PASSPHRASE }}
220242
needs:
221243
- setup-workflow
244+
- get-called-ref
222245
if: ${{ needs.setup-workflow.outputs.skip-workflow != 'Yes' }}
223246
outputs:
224-
sc4s: ${{ steps.meta.outputs.sc4s }}
225-
container_tags: ${{ steps.meta.outputs.container_tags }}
226-
container_labels: ${{ steps.meta.outputs.container_labels }}
227-
container_buildtime: ${{ steps.meta.outputs.container_buildtime }}
228-
container_version: ${{ steps.meta.outputs.container_version }}
229-
container_revision: ${{ steps.meta.outputs.container_revision }}
230-
container_base: ${{ steps.meta.outputs.container_base }}
231-
matrix_supportedSplunk: ${{ steps.meta.outputs.matrix_supportedSplunk }}
232-
matrix_latestSplunk: ${{ steps.meta.outputs.matrix_latestSplunk }}
233-
matrix_supportedSC4S: ${{ steps.meta.outputs.matrix_supportedSC4S }}
234-
matrix_supportedModinputFunctionalVendors: ${{ steps.meta.outputs.matrix_supportedModinputFunctionalVendors }}
235-
matrix_supportedUIVendors: ${{ steps.meta.outputs.matrix_supportedUIVendors }}
236-
python39_splunk: ${{ steps.meta.outputs.python39_splunk }}
237-
python39_sc4s: ${{ steps.meta.outputs.python39_sc4s }}
247+
# outputs from `dynamic-uses` action are passed as a JSON string
248+
sc4s: ${{ fromJSON(steps.meta.outputs.outputs).sc4s }}
249+
container_tags: ${{ fromJSON(steps.meta.outputs.outputs).container_tags }}
250+
container_labels: ${{ fromJSON(steps.meta.outputs.outputs).container_labels }}
251+
container_buildtime: ${{ fromJSON(steps.meta.outputs.outputs).container_buildtime }}
252+
container_version: ${{ fromJSON(steps.meta.outputs.outputs).container_version }}
253+
container_revision: ${{ fromJSON(steps.meta.outputs.outputs).container_revision }}
254+
container_base: ${{ fromJSON(steps.meta.outputs.outputs).container_base }}
255+
matrix_supportedSplunk: ${{ fromJSON(steps.meta.outputs.outputs).matrix_supportedSplunk }}
256+
matrix_latestSplunk: ${{ fromJSON(steps.meta.outputs.outputs).matrix_latestSplunk }}
257+
matrix_supportedSC4S: ${{ fromJSON(steps.meta.outputs.outputs).matrix_supportedSC4S }}
258+
matrix_supportedModinputFunctionalVendors: ${{ fromJSON(steps.meta.outputs.outputs).matrix_supportedModinputFunctionalVendors }}
259+
matrix_supportedUIVendors: ${{ fromJSON(steps.meta.outputs.outputs).matrix_supportedUIVendors }}
260+
python39_splunk: ${{ fromJSON(steps.meta.outputs.outputs).python39_splunk }}
261+
python39_sc4s: ${{ fromJSON(steps.meta.outputs.outputs).python39_sc4s }}
238262
steps:
239-
- name: Run meta preparation
263+
- uses: jenseng/dynamic-uses@v1
240264
id: meta
241-
uses: ./.github/actions/meta
242265
with:
243-
SA_GH_USER_NAME: ${{ secrets.SA_GH_USER_NAME }}
244-
SA_GH_USER_EMAIL: ${{ secrets.SA_GH_USER_EMAIL }}
245-
SA_GPG_PRIVATE_KEY: ${{ secrets.SA_GPG_PRIVATE_KEY }}
246-
SA_GPG_PASSPHRASE: ${{ secrets.SA_GPG_PASSPHRASE }}
266+
uses: splunk/addonfactory-workflow-addon-release/.github/actions/meta@${{ needs.get-called-ref.outputs.ref }}
267+
# inputs need to provided as a valid JSON string
268+
with: ${{ toJSON(env) }}
247269

248270
fossa-scan:
249271
name: FOSSA scan

0 commit comments

Comments
 (0)