forked from a-karthik-bharadwaj-org/veracode-github-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
61 lines (61 loc) · 2.49 KB
/
Copy pathaction.yml
File metadata and controls
61 lines (61 loc) · 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: 'Organization workflow action'
description: 'Action to register organization workflow'
branding:
icon: 'check-circle'
color: 'white'
inputs:
run_id:
description: 'run_id of original commit (provided by GitHub app via `github.event.client_payload.repository.owner`)'
required: true
repositroy_owner:
description: 'repositroy_owner of original commit (provided by GitHub app via `github.event.client_payload.repository.owner`)'
required: true
repositroy_name:
description: 'repositroy_name of original commit (provided by GitHub app via `github.event.client_payload.repository.name`)'
required: true
check_run_name:
description: 'Name of check (Use `github.workflow` to use the name of the workflow)'
required: true
head_sha:
description: 'head_sha of original commit (provided by GitHub app via `github.event.client_payload.sha`)'
required: true
github_token:
description: 'github_token is a token (provided by GitHub app via `github.event.client_payload.token`)'
required: true
event_type:
description: 'event_type triggered by the GitHub App (provided by GitHub app via `github.event.client_payload.event_type`)'
required: true
workflow_artifact_name:
description: 'workflow_artifact_name will be artifact name with .json extension which is uploaded under the Action'
required: true
runs:
using: "composite"
steps:
# Create check run
- name: GitHub API Request to create a check
uses: octokit/[email protected]
id: create_check_run
with:
route: POST /repos/{owner}/{repo}/check-runs
owner: ${{ inputs.repositroy_owner }}
repo: ${{ inputs.repositroy_name }}
name: ${{ inputs.check_run_name }}
head_sha: ${{ inputs.head_sha }}
status: in_progress
details_url: "https://github.com/GitHubVeracode/veracode/actions/runs/${{ inputs.run_id }}"
env:
GITHUB_TOKEN: ${{ inputs.github_token }}
- name: Create metadata
id: create-metadata-json
run: |
echo '{
"check_run_type": "${{ inputs.event_type }}",
"repository_name": "${{ inputs.repositroy_name }}",
"check_run_id": ${{ fromJson(steps.create_check_run.outputs.data).id }}
}' > "${{ fromJson(steps.create_check_run.outputs.data).id }}.json"
shell: bash
- name: Save metadata
uses: actions/upload-artifact@v3
with:
name: workflow-metadata
path: "${{ fromJson(steps.create_check_run.outputs.data).id }}.json"