Skip to content

Commit 02ae7c9

Browse files
committed
Add workflow id
1 parent 53f4d6b commit 02ae7c9

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

.github/workflows/child-workflow-1.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: Child Workflow 1 - Tests
22

33
on:
44
workflow_call:
5+
inputs:
6+
artifact_id:
7+
description: 'Unique identifier for artifacts'
8+
required: true
9+
type: string
510

611
jobs:
712
run-tests:
@@ -36,5 +41,5 @@ jobs:
3641
- name: Upload test results
3742
uses: actions/upload-artifact@v4
3843
with:
39-
name: test-results-child1
44+
name: test-results-${{ inputs.artifact_id }}
4045
path: test-results/

.github/workflows/child-workflow-2.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: Child Workflow 2 - Build & Security
22

33
on:
44
workflow_call:
5+
inputs:
6+
artifact_id:
7+
description: 'Unique identifier for artifacts'
8+
required: true
9+
type: string
510

611

712
jobs:
@@ -27,7 +32,7 @@ jobs:
2732
- name: Upload build artifacts
2833
uses: actions/upload-artifact@v4
2934
with:
30-
name: build-artifacts-child2
35+
name: build-artifacts-${{ inputs.artifact_id }}
3136
path: build/
3237

3338
security-scan:
@@ -51,5 +56,5 @@ jobs:
5156
- name: Upload security results
5257
uses: actions/upload-artifact@v4
5358
with:
54-
name: security-results-child2
59+
name: security-results-${{ inputs.artifact_id }}
5560
path: security-results/

.github/workflows/parent-workflow.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,14 @@ jobs:
1515
run-tests:
1616
name: "Execute Test Suite"
1717
uses: ./.github/workflows/child-workflow-1.yml
18+
with:
19+
artifact_id: "child1"
1820

1921
run-build-security:
2022
name: "Execute Build & Security Checks"
2123
uses: ./.github/workflows/child-workflow-2.yml
24+
with:
25+
artifact_id: "child2"
2226

2327
# Parent workflow job that runs after both children complete
2428
collect-and-deploy:

0 commit comments

Comments
 (0)