@@ -16,13 +16,13 @@ jobs:
1616 name : " Execute Test Suite"
1717 uses : ./.github/workflows/child-workflow-1.yml
1818 with :
19- artifact_id : " child1"
19+ artifact_id : " child1-${{ github.ref_name }}-${{ github.sha }} "
2020
2121 run-build-security :
2222 name : " Execute Build & Security Checks"
2323 uses : ./.github/workflows/child-workflow-2.yml
2424 with :
25- artifact_id : " child2"
25+ artifact_id : " child2-${{ github.ref_name }}-${{ github.sha }} "
2626
2727 # Parent workflow job that runs after both children complete
2828 collect-and-deploy :
@@ -50,46 +50,40 @@ jobs:
5050
5151 echo "✅ All child workflows completed successfully!"
5252
53- - name : Download all artifacts from child workflows
54- uses : actions/download-artifact@v4
53+
54+ - name : Download test artifacts from child workflow 1
55+ uses : actions/download-artifact@v4.1.8
5556 with :
56- path : combined-artifacts/
57+ name : " test-results-child1-${{ github.ref_name }}-${{ github.sha }}"
58+ path : artifacts/
5759
58- - name : Process and combine results
59- run : |
60- echo "Processing combined results from child workflows..."
61- ls -la combined-artifacts/
62-
63- echo "=== Test Results ==="
64- if [ -f "combined-artifacts/test-results-child1/summary.txt" ]; then
65- cat combined-artifacts/test-results-child1/summary.txt
66- fi
67-
68- echo "=== Build Artifacts ==="
69- if [ -f "combined-artifacts/build-artifacts-child2/version.txt" ]; then
70- cat combined-artifacts/build-artifacts-child2/version.txt
71- fi
72-
73- echo "=== Security Results ==="
74- if [ -f "combined-artifacts/security-results-child2/security-report.txt" ]; then
75- cat combined-artifacts/security-results-child2/security-report.txt
76- fi
60+ - name : Download build and security artifacts from child workflow 2
61+ uses : actions/download-artifact@v4.1.8
62+ with :
63+ name : " build-artifacts-child2-${{ github.ref_name }}-${{ github.sha }}"
64+ path : artifacts/
65+
66+ - name : Download security artifacts from child workflow 2
67+ uses : actions/download-artifact@v4.1.8
68+ with :
69+ name : " security-results-child2-${{ github.ref_name }}-${{ github.sha }}"
70+ path : artifacts/
7771
7872 - name : Create deployment package
7973 run : |
8074 echo "Creating deployment package..."
8175 mkdir -p deployment
8276 echo "Deployment ready - $(date)" > deployment/deployment-info.txt
8377
84- # Copy relevant artifacts to deployment folder
85- if [ -d "combined- artifacts/build-artifacts-child2 " ]; then
86- cp -r combined- artifacts/build-artifacts-child2 /* deployment/
78+ # Copy all artifacts to deployment folder
79+ if [ -d "artifacts" ]; then
80+ cp -r artifacts/* deployment/
8781 fi
8882
8983 - name : Upload final deployment artifacts
9084 uses : actions/upload-artifact@v4
9185 with :
92- name : deployment-package
86+ name : " deployment-package-${{ github.ref_name }}-${{ github.sha }} "
9387 path : deployment/
9488
9589 - name : Deployment simulation
0 commit comments