Skip to content

Commit 00aa4d6

Browse files
committed
Handling the cleanup workspace job to remove github workspace after every scans is completed
1 parent 68dd806 commit 00aa4d6

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

.github/workflows/veracode-policy-scan.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,13 @@ jobs:
180180
github-token: ${{ inputs.token }}
181181
commitHash: ${{ inputs.sha }}
182182

183-
- name: cleanup job
183+
cleanup:
184+
runs-on: ${{ fromJson(github.event.client_payload.user_config.default_runs_on) }}
185+
if: always()
186+
needs: [policy_scan, veracode-remove-sandbox, code-scanning-alert, create-issues]
187+
steps:
188+
- name: Cleanup workspace and Docker
184189
if: always()
185190
run: |
186-
echo "Running cleanup..."
187-
sudo rm -rf $GITHUB_WORKSPACE/
191+
echo "Running final cleanup..."
192+
sudo rm -rf $GITHUB_WORKSPACE/

.github/workflows/veracode-sandbox-scan.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ jobs:
7171
cleanup:
7272
runs-on: ${{ fromJson(github.event.client_payload.user_config.default_runs_on) }}
7373
if: always()
74+
needs: [build, sandbox_scan]
7475
steps:
7576
- name: Cleanup workspace and Docker
7677
if: always()

0 commit comments

Comments
 (0)