You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: github-actions/scan/README.adoc
+38-13
Original file line number
Diff line number
Diff line change
@@ -94,25 +94,29 @@ The following variables take priority over the configuration file:
94
94
If no custom `sechub.json` is provided, it will be generated from the remaining specified variables and used. However, if a custom `sechub.json` is provided, no separate configuration will be created, meaning the remaining set variables will essentially be ignored.
95
95
====
96
96
97
-
=== Outputs
97
+
=== Use SecHub results in GitHub workflows
98
98
99
-
The following table lists the output variables available after this SecHub GitHub Action has completed:
99
+
==== GitHub Output
100
+
Because of problems with GitHub outputs (see https://github.com/mercedes-benz/sechub/issues/3481 ) SecHub no longer supports outputs but provides environment variables instead.
101
+
102
+
==== Environment variables
103
+
The following table lists the environment variables containing result data after this SecHub GitHub Action has completed:
| scan-trafficlight | The color of the traffic light reported by SecHub if the scan ran successfully, otherwise `FAILURE`. | One of `GREEN`, `YELLOW`, `RED`, or `FAILURE`.
106
-
| scan-findings-count | The total number of findings reported by SecHub. Returns 0 if the scan didn't complete. | 0
107
-
| scan-findings-high | The number of high-level findings reported by SecHub. | 0
108
-
| scan-findings-medium | The number of medium-level findings reported by SecHub. | 0
109
-
| scan-findings-low | The number of low-level findings reported by SecHub. | 0
110
-
| scan-readable-summary| A human-readable summary of the scan outcome, including the traffic light color, findings count, and their distribution. | For example, `SecHub scan could not be executed` if an error occurred. Otherwise, i.e. `SecHub reported traffic light color YELLOW with 15 findings, categorized as follows: MEDIUM (8), LOW (7)`
109
+
| SECHUB_OUTPUT_SCAN_TRAFFICLIGHT | The color of the traffic light reported by SecHub if the scan ran successfully, otherwise `FAILURE`. | One of `GREEN`, `YELLOW`, `RED`, or `FAILURE`.
110
+
| SECHUB_OUTPUT_SCAN_FINDINGS_COUNT | The total number of findings reported by SecHub. Returns 0 if the scan didn't complete. | 0
111
+
| SECHUB_OUTPUT_SCAN_FINDINGS_HIGH | The number of high-level findings reported by SecHub. | 0
112
+
| SECHUB_OUTPUT_SCAN_FINDINGS_MEDIUM | The number of medium-level findings reported by SecHub. | 0
113
+
| SECHUB_OUTPUT_SCAN_FINDINGS_LOW | The number of low-level findings reported by SecHub. | 0
114
+
| SECHUB_OUTPUT_SCAN_READABLE_SUMMARY| A human-readable summary of the scan outcome, including the traffic light color, findings count, and their distribution. | For example, `SecHub scan could not be executed` if an error occurred. Otherwise, i.e. `SecHub reported traffic light color YELLOW with 15 findings, categorized as follows: MEDIUM (8), LOW (7)`
111
115
112
116
|===
113
117
114
118
115
-
You can access them after the action has run with `${{ steps.<step-id>.outputs.<output-name> }}`
119
+
You can access them after the action has run with `${{ env.<environment-variable-name> }}`
116
120
117
121
=== Build
118
122
@@ -129,6 +133,16 @@ npm run build
129
133
130
134
This runs the ncc compiler and transpiles the files from the src folder into the `dist/` folder.
131
135
136
+
=== Deployment
137
+
A GitHub action needs a transpiled `index.js` to be used as an action from workflows.
138
+
139
+
As long as we do not provide a new index.js the old action is still in usage, even when the source code has
140
+
changed. If we do not build the file and commit and push it to git repository, the action will not
141
+
be available!
142
+
143
+
The complete deployment process is automated by `.github/workflows/release-github-action.yml` which will create a
144
+
PR which will do all necessary steps.
145
+
132
146
=== Test
133
147
134
148
==== Unit tests
@@ -142,10 +156,19 @@ npm run test
142
156
143
157
==== Integration-Test
144
158
As a precondition to run the integration tests locally you have to
# Next lines will start a SecHub server of version 2.4.0 and a PDS with version 2.1.0
167
+
cd ./github-actions/scan/__test__/integrationtest
168
+
./01-start.sh 2.4.0 8443 2.1.0 8444
169
+
----
147
170
148
-
TIP: You can also start a SecHub server and a PDS (both in integration test mode) instead of using the `01-start` script.
171
+
TIP: You can also start a SecHub server and a PDS from IDE (both in integration test mode) instead of using the `01-start` script.
149
172
150
173
After the script has been executed, you can execute integration tests multiple times via following command:
151
174
@@ -176,7 +199,9 @@ In this setup the tests can be executed from sidebar and from links created insi
176
199
177
200
[TIP]
178
201
====
179
-
Unfortunately, the Jest UI integration works only for npm script "test". But to handle integration tests different (the tests shall only be executed when all is build and servers are started) they are not executed by "test" script.
202
+
Unfortunately, the Jest UI integration works only for npm script "test".
203
+
But to handle integration tests different (the tests shall only be executed
204
+
when all is built and servers are started) they are not executed by "test" script.
180
205
181
206
If you want to **debug an integration test**, there is a temporary workaround necessary while you debug the test:
0 commit comments