Skip to content

Commit e5a9d1c

Browse files
authored
Add action typing (#653)
Adds typing to the action definition to support GitHub Workflow Kt (https://github.com/typesafegithub/github-workflows-kt), a Kotlin DSL to write GitHub Action workflows.
1 parent 139ec34 commit e5a9d1c

9 files changed

Lines changed: 1104 additions & 0 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Check Action Typing
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master*'
7+
- 'devel-*'
8+
tags:
9+
- '*'
10+
pull_request:
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
check-action-typing:
17+
name: Check Action Typing
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Check Action Typing
24+
uses: typesafegithub/github-actions-typing@0dc5690c35c564d354dc0c23c56559f0813ed3ac # v2.2.0
25+
with:
26+
ignored-action-files: |-
27+
.github/actions/test/action.yml
28+
misc/action/fetch-workflows/action.yml
29+
misc/action/find-workflows/action.yml
30+
misc/action/json-output/action.yml
31+
misc/action/package-downloads/action.yml

‎README.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ Otherwise, the multiple runs overwrite each other's results.
8686
The action that executed the tests should fail on test failure. The published results however indicate failure if tests fail or errors occur,
8787
which can be [configured](#configuration) via `fail_on`.*
8888

89+
Thanks to the provided [typings](action-types.yml), it is possible to use this action in a type-safe way using
90+
[GitHub Workflows Kt](https://github.com/typesafegithub/github-workflows-kt), which allows writing workflow files using a type-safe Kotlin DSL.
91+
8992
## Permissions
9093

9194
Minimal [workflow job permissions](https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs#example-setting-permissions-for-a-specific-job)

‎action-types.yml‎

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
# See https://github.com/typesafegithub/github-actions-typing/
2+
inputs:
3+
github_token:
4+
type: string
5+
6+
github_token_actor:
7+
type: string
8+
9+
github_retries:
10+
type: integer
11+
12+
ssl_verify:
13+
type: boolean
14+
15+
commit:
16+
type: string
17+
18+
check_name:
19+
type: string
20+
21+
comment_title:
22+
type: string
23+
24+
comment_mode:
25+
type: enum
26+
allowed-values:
27+
- always
28+
- changes
29+
- changes in failures
30+
- changes in errors
31+
- failures
32+
- errors
33+
- off
34+
35+
fail_on:
36+
type: enum
37+
allowed-values:
38+
- nothing
39+
- errors
40+
- test failures
41+
42+
action_fail:
43+
type: boolean
44+
45+
action_fail_on_inconclusive:
46+
type: boolean
47+
48+
files:
49+
type: list
50+
separator: '\n'
51+
list-item:
52+
type: string
53+
54+
junit_files:
55+
type: list
56+
separator: '\n'
57+
list-item:
58+
type: string
59+
60+
nunit_files:
61+
type: list
62+
separator: '\n'
63+
list-item:
64+
type: string
65+
66+
xunit_files:
67+
type: list
68+
separator: '\n'
69+
list-item:
70+
type: string
71+
72+
trx_files:
73+
type: list
74+
separator: '\n'
75+
list-item:
76+
type: string
77+
78+
time_unit:
79+
type: enum
80+
allowed-values:
81+
- seconds
82+
- milliseconds
83+
84+
test_file_prefix:
85+
type: string
86+
87+
report_individual_runs:
88+
type: boolean
89+
90+
report_suite_logs:
91+
type: enum
92+
allowed-values:
93+
- info
94+
- error
95+
- any
96+
- none
97+
98+
deduplicate_classes_by_file_name:
99+
type: boolean
100+
101+
large_files:
102+
type: boolean
103+
104+
ignore_runs:
105+
type: boolean
106+
107+
check_run:
108+
type: boolean
109+
110+
job_summary:
111+
type: boolean
112+
113+
compare_to_earlier_commit:
114+
type: boolean
115+
116+
pull_request_build:
117+
type: enum
118+
allowed-values:
119+
- commit
120+
- merge
121+
122+
event_file:
123+
type: string
124+
125+
event_name:
126+
type: string
127+
128+
test_changes_limit:
129+
type: integer
130+
131+
check_run_annotations:
132+
type: list
133+
separator: ','
134+
list-item:
135+
type: enum
136+
allowed-values:
137+
- all tests
138+
- skipped tests
139+
- none
140+
141+
check_run_annotations_branch:
142+
type: list
143+
separator: ','
144+
list-item:
145+
type: string
146+
147+
seconds_between_github_reads:
148+
type: float
149+
150+
seconds_between_github_writes:
151+
type: float
152+
153+
secondary_rate_limit_wait_seconds:
154+
type: float
155+
156+
json_file:
157+
type: string
158+
159+
json_thousands_separator:
160+
type: string
161+
162+
json_suite_details:
163+
type: boolean
164+
165+
json_test_case_results:
166+
type: boolean
167+
168+
search_pull_requests:
169+
type: boolean
170+
171+
outputs:
172+
json:
173+
type: string

‎composite/action-types.yml‎

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
# See https://github.com/typesafegithub/github-actions-typing/
2+
inputs:
3+
github_token:
4+
type: string
5+
6+
github_token_actor:
7+
type: string
8+
9+
github_retries:
10+
type: integer
11+
12+
ssl_verify:
13+
type: boolean
14+
15+
commit:
16+
type: string
17+
18+
check_name:
19+
type: string
20+
21+
comment_title:
22+
type: string
23+
24+
comment_mode:
25+
type: enum
26+
allowed-values:
27+
- always
28+
- changes
29+
- changes in failures
30+
- changes in errors
31+
- failures
32+
- errors
33+
- off
34+
35+
fail_on:
36+
type: enum
37+
allowed-values:
38+
- nothing
39+
- errors
40+
- test failures
41+
42+
action_fail:
43+
type: boolean
44+
45+
action_fail_on_inconclusive:
46+
type: boolean
47+
48+
files:
49+
type: list
50+
separator: '\n'
51+
list-item:
52+
type: string
53+
54+
junit_files:
55+
type: list
56+
separator: '\n'
57+
list-item:
58+
type: string
59+
60+
nunit_files:
61+
type: list
62+
separator: '\n'
63+
list-item:
64+
type: string
65+
66+
xunit_files:
67+
type: list
68+
separator: '\n'
69+
list-item:
70+
type: string
71+
72+
trx_files:
73+
type: list
74+
separator: '\n'
75+
list-item:
76+
type: string
77+
78+
time_unit:
79+
type: enum
80+
allowed-values:
81+
- seconds
82+
- milliseconds
83+
84+
test_file_prefix:
85+
type: string
86+
87+
report_individual_runs:
88+
type: boolean
89+
90+
report_suite_logs:
91+
type: enum
92+
allowed-values:
93+
- info
94+
- error
95+
- any
96+
- none
97+
98+
deduplicate_classes_by_file_name:
99+
type: boolean
100+
101+
large_files:
102+
type: boolean
103+
104+
ignore_runs:
105+
type: boolean
106+
107+
check_run:
108+
type: boolean
109+
110+
job_summary:
111+
type: boolean
112+
113+
compare_to_earlier_commit:
114+
type: boolean
115+
116+
pull_request_build:
117+
type: enum
118+
allowed-values:
119+
- commit
120+
- merge
121+
122+
event_file:
123+
type: string
124+
125+
event_name:
126+
type: string
127+
128+
test_changes_limit:
129+
type: integer
130+
131+
check_run_annotations:
132+
type: list
133+
separator: ','
134+
list-item:
135+
type: enum
136+
allowed-values:
137+
- all tests
138+
- skipped tests
139+
- none
140+
141+
check_run_annotations_branch:
142+
type: list
143+
separator: ','
144+
list-item:
145+
type: string
146+
147+
seconds_between_github_reads:
148+
type: float
149+
150+
seconds_between_github_writes:
151+
type: float
152+
153+
secondary_rate_limit_wait_seconds:
154+
type: float
155+
156+
json_file:
157+
type: string
158+
159+
json_thousands_separator:
160+
type: string
161+
162+
json_suite_details:
163+
type: boolean
164+
165+
json_test_case_results:
166+
type: boolean
167+
168+
search_pull_requests:
169+
type: boolean
170+
171+
outputs:
172+
json:
173+
type: string

0 commit comments

Comments
 (0)