Skip to content

Commit f2ffdfa

Browse files
removed github app repo dependency from the workflow files
1 parent c955da4 commit f2ffdfa

8 files changed

+131
-80
lines changed

.github/workflows/action.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: 'Organization workflow action'
2+
on:
3+
workflow_call:
4+
inputs:
5+
run_id:
6+
description: 'ID of workflow run (provided via GitHub syntax `github.run_id`)'
7+
required: true
8+
type: string
9+
repositroy_owner:
10+
description: 'repositroy_owner of original commit (provided by GitHub app via `github.event.client_payload.repository.owner`)'
11+
required: true
12+
type: string
13+
repositroy_name:
14+
description: 'repositroy_name of original commit (provided by GitHub app via `github.event.client_payload.repository.name`)'
15+
required: true
16+
type: string
17+
check_run_name:
18+
description: 'Name of check (Use `github.workflow` to use the name of the workflow)'
19+
required: true
20+
type: string
21+
head_sha:
22+
description: 'head_sha of original commit (provided by GitHub app via `github.event.client_payload.sha`)'
23+
required: true
24+
type: string
25+
github_token:
26+
description: 'github_token is a token (provided by GitHub app via `github.event.client_payload.token`)'
27+
required: true
28+
type: string
29+
event_type:
30+
description: 'event_type triggered by the GitHub App (provided by GitHub app via `github.event.client_payload.event_type`)'
31+
required: true
32+
type: string
33+
default_organization_repository:
34+
description: 'default_organization_repository will be workflow repo name where we will have all the workflow related config files'
35+
required: true
36+
type: string
37+
jobs:
38+
reusable_workflow_job:
39+
runs-on: ubuntu-latest
40+
steps:
41+
# Create check run
42+
- name: GitHub API Request to create a check
43+
uses: octokit/request-action@v2.x
44+
id: create_check_run
45+
with:
46+
route: POST /repos/{owner}/{repo}/check-runs
47+
owner: ${{ inputs.repositroy_owner }}
48+
repo: ${{ inputs.repositroy_name }}
49+
name: ${{ inputs.check_run_name }}
50+
head_sha: ${{ inputs.head_sha }}
51+
status: in_progress
52+
details_url: "https://github.com/${{ inputs.repositroy_owner}}/${{ inputs.default_organization_repository }}/actions/runs/${{ inputs.run_id }}"
53+
env:
54+
GITHUB_TOKEN: ${{ inputs.github_token }}
55+
- name: Create metadata
56+
id: create-metadata-json
57+
run: |
58+
echo '{
59+
"check_run_type": "${{ inputs.event_type }}",
60+
"repository_name": "${{ inputs.repositroy_name }}",
61+
"check_run_id": ${{ fromJson(steps.create_check_run.outputs.data).id }}
62+
}' > workflow-metadata.json
63+
shell: bash
64+
- name: Save metadata
65+
uses: actions/upload-artifact@v3
66+
with:
67+
name: workflow-metadata
68+
path: workflow-metadata.json

.github/workflows/binary-ready-veracode-sast-pipeline-scan.yml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,16 @@ on:
88

99
jobs:
1010
register:
11-
runs-on: ubuntu-latest
12-
steps:
13-
- uses: GitHubVeracode/veracode-github-app@main
14-
id: 'create_check_run'
15-
with:
16-
check_run_name: ${{ github.workflow }}
17-
head_sha: ${{ github.event.client_payload.sha }}
18-
repositroy_owner: ${{ github.event.client_payload.repository.owner }}
19-
repositroy_name: ${{ github.event.client_payload.repository.name }}
20-
status: 'in_progress'
21-
event_type: ${{ github.event.client_payload.event_type }}
22-
github_token: ${{ github.event.client_payload.token }}
23-
default_organization_repository: 'veracode'
11+
uses: ./.github/workflows/action.yml
12+
with:
13+
check_run_name: ${{ github.workflow }}
14+
head_sha: ${{ github.event.client_payload.sha }}
15+
repositroy_owner: ${{ github.event.client_payload.repository.owner }}
16+
repositroy_name: ${{ github.event.client_payload.repository.name }}
17+
event_type: ${{ github.event.client_payload.event_type }}
18+
github_token: ${{ github.event.client_payload.token }}
19+
default_organization_repository: 'veracode'
20+
run_id: ${{ github.run_id }}
2421

2522
pipeline_scan:
2623
needs: register

.github/workflows/binary-ready-veracode-sast-policy-scan.yml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,16 @@ on:
88

99
jobs:
1010
register:
11-
runs-on: ubuntu-latest
12-
steps:
13-
- uses: GitHubVeracode/veracode-github-app@main
14-
id: 'create_check_run'
15-
with:
16-
check_run_name: ${{ github.workflow }}
17-
head_sha: ${{ github.event.client_payload.sha }}
18-
repositroy_owner: ${{ github.event.client_payload.repository.owner }}
19-
repositroy_name: ${{ github.event.client_payload.repository.name }}
20-
status: 'in_progress'
21-
event_type: ${{ github.event.client_payload.event_type }}
22-
github_token: ${{ github.event.client_payload.token }}
23-
default_organization_repository: 'veracode'
11+
uses: ./.github/workflows/action.yml
12+
with:
13+
check_run_name: ${{ github.workflow }}
14+
head_sha: ${{ github.event.client_payload.sha }}
15+
repositroy_owner: ${{ github.event.client_payload.repository.owner }}
16+
repositroy_name: ${{ github.event.client_payload.repository.name }}
17+
event_type: ${{ github.event.client_payload.event_type }}
18+
github_token: ${{ github.event.client_payload.token }}
19+
default_organization_repository: 'veracode'
20+
run_id: ${{ github.run_id }}
2421

2522
policy_scan:
2623
needs: register

.github/workflows/veracode-code-analysis.yml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,16 @@ on:
88

99
jobs:
1010
register:
11-
runs-on: ubuntu-latest
12-
steps:
13-
- uses: GitHubVeracode/veracode-github-app@main
14-
id: 'create_check_run'
15-
with:
16-
check_run_name: ${{ github.workflow }}
17-
head_sha: ${{ github.event.client_payload.sha }}
18-
repositroy_owner: ${{ github.event.client_payload.repository.owner }}
19-
repositroy_name: ${{ github.event.client_payload.repository.name }}
20-
status: 'in_progress'
21-
event_type: ${{ github.event.client_payload.event_type }}
22-
github_token: ${{ github.event.client_payload.token }}
23-
default_organization_repository: 'veracode'
11+
uses: ./.github/workflows/action.yml
12+
with:
13+
check_run_name: ${{ github.workflow }}
14+
head_sha: ${{ github.event.client_payload.sha }}
15+
repositroy_owner: ${{ github.event.client_payload.repository.owner }}
16+
repositroy_name: ${{ github.event.client_payload.repository.name }}
17+
event_type: ${{ github.event.client_payload.event_type }}
18+
github_token: ${{ github.event.client_payload.token }}
19+
default_organization_repository: 'veracode'
20+
run_id: ${{ github.run_id }}
2421

2522
build:
2623
needs: register

.github/workflows/veracode-iac-secrets-scan.yml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,16 @@ on:
88

99
jobs:
1010
register:
11-
runs-on: ubuntu-latest
12-
steps:
13-
- uses: GitHubVeracode/veracode-github-app@main
14-
id: 'create_check_run'
15-
with:
16-
check_run_name: ${{ github.workflow }}
17-
head_sha: ${{ github.event.client_payload.sha }}
18-
repositroy_owner: ${{ github.event.client_payload.repository.owner }}
19-
repositroy_name: ${{ github.event.client_payload.repository.name }}
20-
status: 'in_progress'
21-
event_type: ${{ github.event.client_payload.event_type }}
22-
github_token: ${{ github.event.client_payload.token }}
23-
default_organization_repository: 'veracode'
11+
uses: ./.github/workflows/action.yml
12+
with:
13+
check_run_name: ${{ github.workflow }}
14+
head_sha: ${{ github.event.client_payload.sha }}
15+
repositroy_owner: ${{ github.event.client_payload.repository.owner }}
16+
repositroy_name: ${{ github.event.client_payload.repository.name }}
17+
event_type: ${{ github.event.client_payload.event_type }}
18+
github_token: ${{ github.event.client_payload.token }}
19+
default_organization_repository: 'veracode'
20+
run_id: ${{ github.run_id }}
2421

2522
veracode-iac-secrets-scan:
2623
needs: [register]

.github/workflows/veracode-not-supported.yml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,16 @@ on:
88

99
jobs:
1010
register:
11-
runs-on: ubuntu-latest
12-
steps:
13-
- uses: GitHubVeracode/veracode-github-app@main
14-
id: 'create_check_run'
15-
with:
16-
check_run_name: ${{ github.workflow }}
17-
head_sha: ${{ github.event.client_payload.sha }}
18-
repositroy_owner: ${{ github.event.client_payload.repository.owner }}
19-
repositroy_name: ${{ github.event.client_payload.repository.name }}
20-
status: 'in_progress'
21-
event_type: ${{ github.event.client_payload.event_type }}
22-
github_token: ${{ github.event.client_payload.token }}
23-
default_organization_repository: 'veracode'
11+
uses: ./.github/workflows/action.yml
12+
with:
13+
check_run_name: ${{ github.workflow }}
14+
head_sha: ${{ github.event.client_payload.sha }}
15+
repositroy_owner: ${{ github.event.client_payload.repository.owner }}
16+
repositroy_name: ${{ github.event.client_payload.repository.name }}
17+
event_type: ${{ github.event.client_payload.event_type }}
18+
github_token: ${{ github.event.client_payload.token }}
19+
default_organization_repository: 'veracode'
20+
run_id: ${{ github.run_id }}
2421

2522
veracode-not-supported:
2623
needs: [register]

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

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,16 @@ on:
88

99
jobs:
1010
register:
11-
runs-on: ubuntu-latest
12-
steps:
13-
- uses: GitHubVeracode/veracode-github-app@main
14-
id: 'create_check_run'
15-
with:
16-
check_run_name: ${{ github.workflow }}
17-
head_sha: ${{ github.event.client_payload.sha }}
18-
repositroy_owner: ${{ github.event.client_payload.repository.owner }}
19-
repositroy_name: ${{ github.event.client_payload.repository.name }}
20-
status: 'in_progress'
21-
event_type: ${{ github.event.client_payload.event_type }}
22-
github_token: ${{ github.event.client_payload.token }}
23-
default_organization_repository: 'veracode'
11+
uses: ./.github/workflows/action.yml
12+
with:
13+
check_run_name: ${{ github.workflow }}
14+
head_sha: ${{ github.event.client_payload.sha }}
15+
repositroy_owner: ${{ github.event.client_payload.repository.owner }}
16+
repositroy_name: ${{ github.event.client_payload.repository.name }}
17+
event_type: ${{ github.event.client_payload.event_type }}
18+
github_token: ${{ github.event.client_payload.token }}
19+
default_organization_repository: 'veracode'
20+
run_id: ${{ github.run_id }}
2421

2522
veracode-sca-scan:
2623
needs: [register]

veracode.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ veracode_sast_pipeline_scan:
55
push:
66
trigger: true
77
branches_to_run:
8+
- default_branch
89
branches_to_exclude:
910
- default_branch
1011
pull_request:
@@ -29,7 +30,7 @@ veracode_sast_policy_scan:
2930
# pull request event. Specifying both will only execute push event.
3031
# Leaving them both false means this will never run
3132
push:
32-
trigger: false
33+
trigger: true
3334
branches_to_run:
3435
- default_branch
3536
branches_to_exclude:
@@ -55,7 +56,7 @@ veracode_sca_scan:
5556
# pull request event. Specifying both will only execute push event.
5657
# Leaving them both false means this will never run
5758
push:
58-
trigger: false
59+
trigger: true
5960
branches_to_run:
6061
- "*"
6162
branches_to_exclude:

0 commit comments

Comments
 (0)