@@ -56,19 +56,47 @@ jobs:
56
56
filePath : ${{ matrix.manifest.filePath }}
57
57
repositoryId : ${{ matrix.manifest.repositoryId }}
58
58
projectGroupId : ${{ matrix.manifest.projectGroupId }}
59
- - name : Print Contrast Audit Log (for debugging)
59
+ # --- Debugging Steps (CRITICAL for your issue) ---
60
+
61
+ # Step 1: List files to confirm the log file's presence and location
62
+ - name : List Files After Contrast Audit
63
+ if : always() # Run this step even if the previous audit step fails
60
64
run : |
61
- if [ -f "pom.xml.contrast.log" ]; then
62
- echo "--- Content of pom.xml.contrast.log ---"
63
- cat pom.xml.contrast.log
64
- echo "---------------------------------------"
65
+ echo "Listing files in current directory (should be /home/runner/work/mcp-contrast/mcp-contrast):"
66
+ ls -F
67
+ echo ""
68
+ echo "Listing files recursively from current directory:"
69
+ ls -R
70
+ echo ""
71
+ echo "Searching for any file containing 'contrast.log' in its name:"
72
+ find . -name "*contrast.log*"
73
+
74
+ # Step 2: Print the content of the expected log file to the job output
75
+ - name : Print Contrast Audit Log Content
76
+ if : always() # Run this step even if the previous audit step fails
77
+ run : |
78
+ LOG_FILE="pom.xml.contrast.log"
79
+ if [ -f "$LOG_FILE" ]; then
80
+ echo "--- START OF $LOG_FILE CONTENT ---"
81
+ cat "$LOG_FILE"
82
+ echo "--- END OF $LOG_FILE CONTENT ---"
65
83
else
66
- echo "pom.xml.contrast.log not found."
84
+ echo "WARNING: Log file '$LOG_FILE' was not found at this path ."
67
85
fi
68
- if : always() # Always run this step
69
- - name : Upload Contrast Audit Log
86
+
87
+ # Step 3: Upload the log file as an artifact
88
+ - name : Upload Contrast Audit Log Artifact
70
89
uses : actions/upload-artifact@v4
71
90
with :
72
- name : contrast-audit-log
73
- path : pom.xml.contrast.log
74
- if : always() # Upload even on failure to get the log
91
+ name : contrast-sca-audit-log
92
+ path : pom.xml.contrast.log # <--- !!! THIS IS THE CRUCIAL FIX !!! Ensure this matches the log file name
93
+ retention-days : 5 # Optional: how long to keep the artifact
94
+ if : always() # Upload even if the job fails, so you can inspect the log
95
+
96
+ # --- Optional: Notifications/Status Updates ---
97
+ # Example: Post a status if the audit failed (as seen in your original output)
98
+ - name : Audit Status Check
99
+ if : ${{ failure() }}
100
+ run : |
101
+ echo "Audit failed check logs in pom.xml.contrast.log for more info"
102
+ exit 1 # Ensures the workflow step also fails if this condition is met
0 commit comments