Skip to content

Commit 03e053b

Browse files
authored
change custom attestation type (#39)
* Change the custom attestation type to match what we now get from github * Updated to version 14
1 parent f18910b commit 03e053b

File tree

3 files changed

+121
-81
lines changed

3 files changed

+121
-81
lines changed

.github/workflows/setup-kosli.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: Create approval-github-workflow attestation type
3838
run:
3939
kosli create attestation-type approval-github-workflow
40-
--description "Approval from GitHub workflow"
41-
--schema custom-attestation-types/approval-github-workflow.yml
42-
--jq '.action == "workflows.approve_workflow_job"'
43-
--jq '.actor != ""'
40+
--description "Approval from GitHub workflow"
41+
--schema custom-attestation-types/approval-github-workflow.yml
42+
--jq '.state == "approved"'
43+
--jq '.user.login != ""'

apps/backend/backend-content.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
This is just a file to test out that changes to back-end source code
22
can trigger a build, reporting to Kosli
33

4-
counter=13
4+
counter=14
Lines changed: 116 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,128 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
3-
"title": "GitHub Audit Log Approval Entry",
3+
"title": "GitHub Workflow Approval Entry",
44
"type": "object",
55
"properties": {
6-
"@timestamp": {
7-
"type": "integer",
8-
"description": "Timestamp in milliseconds since epoch"
9-
},
10-
"_document_id": {
11-
"type": "string"
12-
},
13-
"action": {
6+
"user": {
7+
"type": "object",
8+
"properties": {
9+
"login": {
10+
"type": "string",
11+
"description": "GitHub username of the approver"
12+
},
13+
"id": {
14+
"type": "integer",
15+
"description": "GitHub user ID"
16+
},
17+
"node_id": {
18+
"type": "string"
19+
},
20+
"avatar_url": {
21+
"type": "string"
22+
},
23+
"gravatar_id": {
24+
"type": "string"
25+
},
26+
"url": {
27+
"type": "string"
28+
},
29+
"html_url": {
30+
"type": "string"
31+
},
32+
"followers_url": {
33+
"type": "string"
34+
},
35+
"following_url": {
36+
"type": "string"
37+
},
38+
"gists_url": {
39+
"type": "string"
40+
},
41+
"starred_url": {
42+
"type": "string"
43+
},
44+
"subscriptions_url": {
45+
"type": "string"
46+
},
47+
"organizations_url": {
48+
"type": "string"
49+
},
50+
"repos_url": {
51+
"type": "string"
52+
},
53+
"events_url": {
54+
"type": "string"
55+
},
56+
"received_events_url": {
57+
"type": "string"
58+
},
59+
"type": {
60+
"type": "string",
61+
"enum": ["User", "Bot"]
62+
},
63+
"user_view_type": {
64+
"type": "string"
65+
},
66+
"site_admin": {
67+
"type": "boolean"
68+
}
69+
},
70+
"required": ["login", "id", "type"]
71+
},
72+
"state": {
1473
"type": "string",
15-
"enum": ["workflows.approve_workflow_job"]
16-
},
17-
"actor": {
18-
"type": "string"
19-
},
20-
"actor_id": {
21-
"type": "integer"
22-
},
23-
"actor_is_bot": {
24-
"type": "boolean"
74+
"enum": ["approved", "rejected"],
75+
"description": "Approval state"
2576
},
26-
"business": {
27-
"type": "string"
28-
},
29-
"business_id": {
30-
"type": "integer"
31-
},
32-
"created_at": {
33-
"type": "integer",
34-
"description": "Timestamp in milliseconds since epoch"
35-
},
36-
"operation_type": {
77+
"comment": {
3778
"type": "string",
38-
"enum": ["modify"]
39-
},
40-
"org": {
41-
"type": "string"
42-
},
43-
"org_id": {
44-
"type": "integer"
45-
},
46-
"public_repo": {
47-
"type": "boolean"
48-
},
49-
"repo": {
50-
"type": "string"
51-
},
52-
"repo_id": {
53-
"type": "integer"
54-
},
55-
"request_access_security_header": {
56-
"type": ["string", "null"]
57-
},
58-
"run_number": {
59-
"type": "integer"
60-
},
61-
"user_agent": {
62-
"type": "string"
63-
},
64-
"workflow_run_id": {
65-
"type": "integer"
79+
"description": "Optional comment provided with the approval"
80+
},
81+
"environments": {
82+
"type": "array",
83+
"items": {
84+
"type": "object",
85+
"properties": {
86+
"id": {
87+
"type": "integer",
88+
"description": "Environment ID"
89+
},
90+
"node_id": {
91+
"type": "string"
92+
},
93+
"name": {
94+
"type": "string",
95+
"description": "Environment name (e.g., 'Stage', 'Production')"
96+
},
97+
"url": {
98+
"type": "string"
99+
},
100+
"html_url": {
101+
"type": "string"
102+
},
103+
"created_at": {
104+
"type": "string",
105+
"format": "date-time",
106+
"description": "ISO 8601 timestamp"
107+
},
108+
"updated_at": {
109+
"type": "string",
110+
"format": "date-time",
111+
"description": "ISO 8601 timestamp"
112+
},
113+
"can_admins_bypass": {
114+
"type": "boolean"
115+
}
116+
},
117+
"required": ["id", "name", "created_at", "updated_at"]
118+
},
119+
"minItems": 1
66120
}
67121
},
68122
"required": [
69-
"@timestamp",
70-
"_document_id",
71-
"action",
72-
"actor",
73-
"actor_id",
74-
"actor_is_bot",
75-
"business",
76-
"business_id",
77-
"created_at",
78-
"operation_type",
79-
"org",
80-
"org_id",
81-
"public_repo",
82-
"repo",
83-
"repo_id",
84-
"run_number",
85-
"user_agent",
86-
"workflow_run_id"
123+
"user",
124+
"state",
125+
"comment",
126+
"environments"
87127
]
88128
}

0 commit comments

Comments
 (0)