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
* Added support for specifying branch during analysis
* Naming changes: Renamed "Code Dx" -> "SRM"
* Test: Update main.yml
* Test: Update upload name in main.yml
* Update README.md and revert test commit
* Addressing review comments
* Added `project-name` config support
Also addressing previous review comments
* Minor update to README and error log message
* Added `dist` folder changes
* Minor update to log message and dist files
Copy file name to clipboardExpand all lines: README.md
+24-17Lines changed: 24 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
# GitHub Action for Code Dx
1
+
# GitHub Action for SRM
2
2
3
-
This GitHub action can be used to push source code, binaries, and scan results to a [Code Dx](https://codedx.com) instance from within a GitHub workflow; source and binaries are automatically scanned by Code Dx using its built-in analysis tools.
3
+
This GitHub action can be used to push source code, binaries, and scan results to an [SRM](https://www.synopsys.com/software-integrity/software-risk-manager.html) instance from within a GitHub workflow; source and binaries are automatically scanned by SRM using its built-in analysis tools.
4
4
5
5
## Features and Behavior
6
6
@@ -11,28 +11,35 @@ The Action can optionally wait for analysis completion, writing the final status
11
11
The workflow will be set to fail if:
12
12
13
13
- The source/binaries glob(s) fail to match any files
14
-
- There are any errors when contacting your Code Dx server
14
+
- There are any errors when contacting your SRM server
15
15
- The analysis ends in failure
16
16
17
17
## Requirements
18
18
19
-
- A deployed, licensed instance of Code Dx (any license)
20
-
- Access from GitHub to Code Dx via HTTP, or via HTTPS with a recognizable certificate (use the `ca-cert` param if not using a public CA)
21
-
- A Project in Code Dx to store results
19
+
- A deployed, licensed instance of SRM (any license)
20
+
- Access from GitHub to SRM via HTTP, or via HTTPS with a recognizable certificate (use the `ca-cert` param if not using a public CA)
21
+
- A Project in SRM to store results
22
22
- An API Key or Personal Access Token with "Create" permissions for the Project
23
23
24
24
## Action Inputs
25
25
26
-
| Input Name | Description | Default Value | Required |
|`server-url`| The URL for the Code Dx server (typically ends with `/codedx`) || Yes |
29
-
|`api-key`| An API Key or Personal Access Token to use when connecting to Code Dx || Yes |
30
-
|`project-id`| The ID of a project (an integer) created in Code Dx || Yes |
31
-
|`source-and-binaries-glob`| A comma-separated-list of file globs matching source and binary files to be packaged and sent to Code Dx |`undefined`| No |
32
-
|`tool-outputs-glob`| A comma-separated list of file globs matching tool output/scan result files |`undefined`| No |
33
-
|`wait-for-completion`| Whether to wait for the analysis to complete before exiting |`false`| No |
34
-
|`ca-cert`| A custom CA cert to use for HTTPS connections to Code Dx |`undefined`| No |
35
-
|`dry-run`| Whether to submit an analysis (false/undefined) or only test the connection and credentials (true) |`undefined`| No |
26
+
| Input Name | Description | Default Value | Required |
|`server-url`| The URL for the SRM server (typically ends with `/srm`) || Yes |
29
+
|`api-key`| An API Key or Personal Access Token to use when connecting to SRM || Yes |
30
+
|`project-id`| The ID of a project (an integer) created in SRM |`undefined`| Yes<sup>1</sup> |
31
+
|`project-name`| The name of a project created in SRM |`undefined`| Yes<sup>1</sup> |
32
+
|`base-branch-name`| The parent branch name of a project created in SRM |`undefined`| No<sup>2</sup> |
33
+
|`target-branch-name`| The target branch name of a project created in SRM. <br/>SRM automatically creates the branch if it does not exist yet in the project, and the new branch will be created from `base-branch-name`|`undefined`| No |
34
+
|`source-and-binaries-glob`| A comma-separated-list of file globs matching source and binary files to be packaged and sent to SRM |`undefined`| No |
35
+
|`tool-outputs-glob`| A comma-separated list of file globs matching tool output/scan result files |`undefined`| No |
36
+
|`wait-for-completion`| Whether to wait for the analysis to complete before exiting |`false`| No |
37
+
|`ca-cert`| A custom CA cert to use for HTTPS connections to SRM |`undefined`| No |
38
+
|`dry-run`| Whether to submit an analysis (false/undefined) or only test the connection and credentials (true) |`undefined`| No |
39
+
40
+
**Notes**
41
+
1. Either `project-id` or `project-name` is required. An error will be thrown if neither is specified or both are specified.
42
+
2.`base-branch-name` is required if `target-branch-name` is specified and doesn't exist yet in the project.
Copy file name to clipboardExpand all lines: action.yml
+17-8Lines changed: 17 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,27 @@
1
-
name: 'Code Dx Analysis'
2
-
description: 'Analyze your source code and binaries with Code Dx'
1
+
name: 'SRM Analysis'
2
+
description: 'Analyze your source code and binaries with SRM'
3
3
inputs:
4
4
# main config options
5
5
server-url:
6
-
description: 'the URL for the Code Dx server (typically ends with `/codedx`)'
6
+
description: 'the URL for the SRM server (typically ends with `/srm`)'
7
7
required: true
8
8
api-key:
9
-
description: 'an API key or Personal Access Token (PAT) to use when connecting to Code Dx'
9
+
description: 'an API key or Personal Access Token (PAT) to use when connecting to SRM'
10
10
required: true
11
11
project-id:
12
-
description: 'the ID of a project (an integer) created in Code Dx'
13
-
required: true
12
+
description: 'the ID of a project (an integer) created in SRM. This is required if `project-name` is not specified.'
13
+
required: false
14
+
project-name:
15
+
description: 'the name of a project created in SRM. This is required if `project-id` is not specified.'
16
+
required: false
17
+
base-branch-name:
18
+
description: 'the parent branch name of a project created in SRM'
19
+
required: false
20
+
target-branch-name:
21
+
description: 'the target branch name of a project created in SRM. SRM automatically creates the branch if it does not exist yet in the project, and the new branch will be created from `base-branch-name`'
22
+
required: false
14
23
source-and-binaries-glob:
15
-
description: 'a file glob matching source and binary files (accepts multiple comma-separated globs). if not set, no source/binary files will be sent to Code Dx'
24
+
description: 'a file glob matching source and binary files (accepts multiple comma-separated globs). if not set, no source/binary files will be sent to SRM'
16
25
required: true
17
26
tool-outputs-glob:
18
27
description: 'a file glob matching output files (ie scan results) from an analysis tool (accepts multiple comma-separated globs)'
@@ -24,7 +33,7 @@ inputs:
24
33
required: false
25
34
default: false
26
35
ca-cert:
27
-
description: 'a custom CA cert to use for HTTPS requests to Code Dx'
36
+
description: 'a custom CA cert to use for HTTPS requests to SRM'
28
37
required: false
29
38
dry-run:
30
39
description: 'whether to submit an analysis (false/undefined), or only test the connection and credentials (true). an error in validation will fail the build.'
thrownewError(`No projects with the name '${config.projectName}'.`)
146
+
}else{
147
+
thrownewError(`Multiple projects with the name '${config.projectName}'. Unable to determine which project to use. Try specifying with 'project-id' instead.`)
148
+
}
149
+
}elseif(!config.projectId&&!config.projectName){
150
+
// If neither is defined, throw error
151
+
thrownewError(`No projects specified. Make sure to specify either 'project-id' or 'project-name'.`)
152
+
}else{
153
+
// If both are defined, throw error
154
+
thrownewError(`Both 'project-id' and 'project-name' are specified. Unable to determine which project to use. Make sure to specify either 'project-id' or 'project-name'.`)
155
+
}
156
+
}
157
+
107
158
// most @actions toolkit packages have async methods
0 commit comments