-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (70 loc) · 2.76 KB
/
veracode-check-run.yml
File metadata and controls
72 lines (70 loc) · 2.76 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
62
63
64
65
66
67
68
69
70
71
72
name: 'Organization workflow action'
on:
workflow_call:
outputs:
run_id:
description: "The first output string"
value: ${{ jobs.create_check_run.outputs.run_id }}
inputs:
run_id:
description: 'ID of workflow run (provided via GitHub syntax `github.run_id`)'
required: true
type: string
repositroy_owner:
description: 'repositroy_owner of original commit (provided by GitHub app via `github.event.client_payload.repository.owner`)'
required: true
type: string
repositroy_name:
description: 'repositroy_name of original commit (provided by GitHub app via `github.event.client_payload.repository.name`)'
required: true
type: string
check_run_name:
description: 'Name of check (Use `github.workflow` to use the name of the workflow)'
required: true
type: string
head_sha:
description: 'head_sha of original commit (provided by GitHub app via `github.event.client_payload.sha`)'
required: true
type: string
github_token:
description: 'github_token is a token (provided by GitHub app via `github.event.client_payload.token`)'
required: true
type: string
event_type:
description: 'event_type triggered by the GitHub App (provided by GitHub app via `github.event.client_payload.event_type`)'
required: true
type: string
jobs:
create_check_run:
runs-on: ubuntu-latest
outputs:
run_id: ${{ fromJson(steps.create_check_run.outputs.data).id }}
steps:
# Create check run
- name: GitHub API Request to create a check
uses: octokit/request-action@v2.x
id: create_check_run
with:
route: POST /repos/{owner}/{repo}/check-runs
env:
GITHUB_TOKEN: ${{ inputs.github_token }}
INPUT_OWNER: ${{ inputs.repositroy_owner }}
INPUT_REPO: ${{ inputs.repositroy_name }}
INPUT_NAME: ${{ inputs.check_run_name }}
INPUT_HEAD_SHA: ${{ inputs.head_sha }}
INPUT_DETAILS_URL: "https://github.com/${{ github.repository }}/actions/runs/${{ inputs.run_id }}"
- 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 }}
}' > workflow-metadata.json
echo "run_id=${{ fromJson(steps.create_check_run.outputs.data).id }}" >> "GITHUB_OUTPUT"
shell: bash
- name: Save metadata
uses: actions/upload-artifact@v3
with:
name: workflow-metadata
path: workflow-metadata.json