Skip to content

Commit f48fba2

Browse files
authored
Merge pull request #37 from thc202/write-all-dir
Allow to write any file to the workspace
2 parents 20577ca + 2a23248 commit f48fba2

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
88
### Changed
99
- Update dependencies.
1010

11+
### Fixed
12+
- Allow to write any file from the Docker container. [#22](https://github.com/zaproxy/action-api-scan/issues/22)
13+
1114
## [0.7.0] - 2024-04-02
1215
### Changed
1316
- Update dependencies.

dist/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59638,9 +59638,8 @@ async function run() {
5963859638
plugins = await common.helper.processLineByLine(`${workspace}/${rulesFileLocation}`);
5963959639
}
5964059640

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

5964559644
await exec.exec(`docker pull ${docker_name} -q`);
5964659645
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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ async function run() {
4747
plugins = await common.helper.processLineByLine(`${workspace}/${rulesFileLocation}`);
4848
}
4949

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

5453
await exec.exec(`docker pull ${docker_name} -q`);
5554
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)