Skip to content

Commit a9fbae9

Browse files
authored
Allow to write any file to the workspace (#90)
Support any file not just the default reports. Signed-off-by: thc202 <[email protected]>
1 parent 2caa057 commit a9fbae9

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
77
### Changed
88
- Update dependencies.
99

10+
### Fixed
11+
- Allow to write any file from the Docker container.
12+
1013
## [0.10.0] - 2024-04-02
1114
### Changed
1215
- Update dependencies.

dist/index.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -59636,9 +59636,8 @@ async function run() {
5963659636
plugins = await common.helper.processLineByLine(`${workspace}/${rulesFileLocation}`);
5963759637
}
5963859638

59639-
// Create the files so we can change the perms and allow the docker non root user to update them
59640-
await exec.exec(`touch ${jsonReportName} ${mdReportName} ${htmlReportName}`);
59641-
await exec.exec(`chmod a+w ${jsonReportName} ${mdReportName} ${htmlReportName}`);
59639+
// Allow writing files from the Docker container.
59640+
await exec.exec(`chmod a+w ${workspace}`);
5964259641

5964359642
await exec.exec(`docker pull ${docker_name} -q`);
5964459643
let command = (`docker run -v ${workspace}:/zap/wrk/:rw --network="host" -e ZAP_AUTH_HEADER -e ZAP_AUTH_HEADER_VALUE -e ZAP_AUTH_HEADER_SITE ` +

index.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,8 @@ async function run() {
4545
plugins = await common.helper.processLineByLine(`${workspace}/${rulesFileLocation}`);
4646
}
4747

48-
// Create the files so we can change the perms and allow the docker non root user to update them
49-
await exec.exec(`touch ${jsonReportName} ${mdReportName} ${htmlReportName}`);
50-
await exec.exec(`chmod a+w ${jsonReportName} ${mdReportName} ${htmlReportName}`);
48+
// Allow writing files from the Docker container.
49+
await exec.exec(`chmod a+w ${workspace}`);
5150

5251
await exec.exec(`docker pull ${docker_name} -q`);
5352
let command = (`docker run -v ${workspace}:/zap/wrk/:rw --network="host" -e ZAP_AUTH_HEADER -e ZAP_AUTH_HEADER_VALUE -e ZAP_AUTH_HEADER_SITE ` +

0 commit comments

Comments
 (0)