Skip to content

Commit

Permalink
OWASP OWASP#714 : Fixing workflow triggering isues
Browse files Browse the repository at this point in the history
  • Loading branch information
puneeth072003 committed Oct 31, 2023
1 parent 3eb84e5 commit d68db2d
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions .github/workflows/dast-zap-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,7 @@ jobs:
- name: Trigger Building JAR cache
if: steps.cache.outputs.cache-hit != 'true'
run: |
const { Octokit } = require("@octokit/core");
const octokit = new Octokit({ auth: process.env.GITHUB_TOKEN });
const { data: workflows } = await octokit.request("GET /repos/commjoen/wrongsecrets/actions/workflows", {
owner: process.env.GITHUB_REPOSITORY.split("/")[0],
repo: process.env.GITHUB_REPOSITORY.split("/")[1]
});
const secondWorkflow = workflows.workflows.find(w => w.name === "building-jar-cache.yml");
if (secondWorkflow) {
await octokit.request("POST /repos/commjoen/wrongsecrets/actions/workflows/Building JAR cache/dispatches", {
owner: process.env.GITHUB_REPOSITORY.split("/")[0],
repo: process.env.GITHUB_REPOSITORY.split("/")[1],
workflow_id: secondWorkflow.id
});
}
gh workflow run "Building JAR cache" --ref "main"
- name: Start wrongsecrets
run: nohup ./mvnw spring-boot:run -Dspring-boot.run.profiles=without-vault &
- name: ZAP Scan
Expand Down

0 comments on commit d68db2d

Please sign in to comment.