Skip to content

Commit 6710000

Browse files
authored
Add typing information for use by typesafegithub (#910)
Introduces type descriptor YAML files for GitHub Actions in the repository, improving type safety and documentation for action inputs and outputs. It also adds a new GitHub Actions workflow to validate these typings automatically on pushes and pull requests. The changes are grouped into the addition of type descriptor files for various actions and the automation of their validation. https://github.com/typesafegithub/github-actions-typing **Type descriptor files for GitHub Actions:** * Added `action-types.yml` files to `setup-gradle`, `dependency-submission`, and `wrapper-validation` actions, specifying input and output types for each action to improve type safety and documentation. [[1]](diffhunk://#diff-542de74831b6dc1954ff20a4c329b170053c82087ea7df742bd536156133f25bR1-R171) [[2]](diffhunk://#diff-44708a3af3d0f3cfed1873f9b77d7e815c6c14e941fa3dd5ed08835a69d67855R1-R146) [[3]](diffhunk://#diff-3fe1028d7aa5ee815c90fa580d4f62e646f0b9a4b7372f227fc131a56948ace0R1-R17) **Automation and validation:** * Introduced a new GitHub Actions workflow `.github/workflows/ci-validate-typings.yml` to automatically validate action typings on pushes to `main` and `release/**` branches, as well as on pull requests. This uses the `github-actions-typing` action for validation.
2 parents 310f24c + 3d0e2a8 commit 6710000

4 files changed

Lines changed: 358 additions & 0 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: ci-validate-typings.yml
2+
on:
3+
push:
4+
branches:
5+
- 'main'
6+
- 'release/**'
7+
paths-ignore:
8+
- 'dist/**'
9+
pull_request:
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
validate-typings:
16+
runs-on: "ubuntu-latest"
17+
steps:
18+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
19+
- uses: typesafegithub/github-actions-typing@9ddf35b71a482be7d8922b28e8d00df16b77e315 # v2.2.2
20+
with:
21+
ignored-action-files: |
22+
.github/actions/build-dist/action.yml
23+
.github/actions/init-integ-test/action.yml
24+
action.yml
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
# Type descriptors based on https://github.com/typesafegithub/github-actions-typing
2+
inputs:
3+
# Gradle execution configuration
4+
gradle-version:
5+
type: string
6+
7+
build-root-directory:
8+
type: string
9+
10+
dependency-resolution-task:
11+
type: string
12+
13+
additional-arguments:
14+
type: string
15+
16+
# Cache configuration
17+
cache-disabled:
18+
type: boolean
19+
20+
cache-read-only:
21+
type: boolean
22+
23+
cache-write-only:
24+
type: boolean
25+
26+
cache-overwrite-existing:
27+
type: boolean
28+
29+
cache-encryption-key:
30+
type: string
31+
32+
cache-cleanup:
33+
type: enum
34+
allowed-values:
35+
- never
36+
- on-success
37+
- always
38+
39+
gradle-home-cache-cleanup:
40+
type: boolean
41+
42+
gradle-home-cache-includes:
43+
type: list
44+
separator: '\n'
45+
list-item:
46+
type: string
47+
48+
gradle-home-cache-excludes:
49+
type: list
50+
separator: '\n'
51+
list-item:
52+
type: string
53+
54+
# Job summary configuration
55+
add-job-summary:
56+
type: enum
57+
allowed-values:
58+
- never
59+
- always
60+
- on-failure
61+
62+
add-job-summary-as-pr-comment:
63+
type: enum
64+
allowed-values:
65+
- never
66+
- always
67+
- on-failure
68+
69+
# Dependency Graph configuration
70+
dependency-graph:
71+
type: enum
72+
allowed-values:
73+
- generate-and-submit
74+
- generate-submit-and-upload
75+
- generate-and-upload
76+
- download-and-submit
77+
78+
dependency-graph-report-dir:
79+
type: string
80+
81+
dependency-graph-continue-on-failure:
82+
type: boolean
83+
84+
dependency-graph-exclude-projects:
85+
type: string
86+
87+
dependency-graph-include-projects:
88+
type: string
89+
90+
dependency-graph-exclude-configurations:
91+
type: string
92+
93+
dependency-graph-include-configurations:
94+
type: string
95+
96+
artifact-retention-days:
97+
type: integer
98+
99+
# Build Scan configuration
100+
build-scan-publish:
101+
type: boolean
102+
103+
build-scan-terms-of-use-url:
104+
type: enum
105+
allowed-values:
106+
- https://gradle.com/terms-of-service
107+
- https://gradle.com/help/legal-terms-of-use
108+
109+
build-scan-terms-of-use-agree:
110+
type: enum
111+
allowed-values:
112+
- 'yes'
113+
114+
develocity-access-key:
115+
type: string
116+
117+
develocity-token-expiry:
118+
type: integer
119+
120+
# Wrapper validation configuration
121+
validate-wrappers:
122+
type: boolean
123+
124+
allow-snapshot-wrappers:
125+
type: boolean
126+
127+
# Experimental action inputs
128+
gradle-home-cache-strict-match:
129+
type: boolean
130+
131+
# Internal action inputs
132+
workflow-job-context:
133+
type: string
134+
135+
github-token:
136+
type: string
137+
138+
outputs:
139+
build-scan-url:
140+
type: string
141+
142+
dependency-graph-file:
143+
type: string
144+
145+
gradle-version:
146+
type: string

setup-gradle/action-types.yml

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
# Type descriptors based on https://github.com/typesafegithub/github-actions-typing
2+
inputs:
3+
gradle-version:
4+
type: string
5+
6+
# Cache configuration
7+
cache-disabled:
8+
type: boolean
9+
10+
cache-read-only:
11+
type: boolean
12+
13+
cache-write-only:
14+
type: boolean
15+
16+
cache-overwrite-existing:
17+
type: boolean
18+
19+
cache-encryption-key:
20+
type: string
21+
22+
cache-cleanup:
23+
type: enum
24+
allowed-values:
25+
- never
26+
- on-success
27+
- always
28+
29+
gradle-home-cache-cleanup:
30+
type: boolean
31+
32+
gradle-home-cache-includes:
33+
type: list
34+
separator: '\n'
35+
list-item:
36+
type: string
37+
38+
gradle-home-cache-excludes:
39+
type: list
40+
separator: '\n'
41+
list-item:
42+
type: string
43+
44+
# Job summary configuration
45+
add-job-summary:
46+
type: enum
47+
allowed-values:
48+
- never
49+
- always
50+
- on-failure
51+
52+
add-job-summary-as-pr-comment:
53+
type: enum
54+
allowed-values:
55+
- never
56+
- always
57+
- on-failure
58+
59+
# Dependency Graph configuration
60+
dependency-graph:
61+
type: enum
62+
allowed-values:
63+
- disabled
64+
- generate
65+
- generate-and-submit
66+
- generate-and-upload
67+
- download-and-submit
68+
69+
dependency-graph-report-dir:
70+
type: string
71+
72+
dependency-graph-continue-on-failure:
73+
type: boolean
74+
75+
dependency-graph-exclude-projects:
76+
type: string
77+
78+
dependency-graph-include-projects:
79+
type: string
80+
81+
dependency-graph-exclude-configurations:
82+
type: string
83+
84+
dependency-graph-include-configurations:
85+
type: string
86+
87+
artifact-retention-days:
88+
type: integer
89+
90+
# Build Scan configuration
91+
build-scan-publish:
92+
type: boolean
93+
94+
build-scan-terms-of-use-url:
95+
type: enum
96+
allowed-values:
97+
- https://gradle.com/terms-of-service
98+
- https://gradle.com/help/legal-terms-of-use
99+
100+
build-scan-terms-of-use-agree:
101+
type: enum
102+
allowed-values:
103+
- 'yes'
104+
105+
develocity-access-key:
106+
type: string
107+
108+
develocity-token-expiry:
109+
type: integer
110+
111+
develocity-injection-enabled:
112+
type: boolean
113+
114+
develocity-url:
115+
type: string
116+
117+
develocity-allow-untrusted-server:
118+
type: boolean
119+
120+
develocity-capture-file-fingerprints:
121+
type: boolean
122+
123+
develocity-enforce-url:
124+
type: boolean
125+
126+
develocity-plugin-version:
127+
type: string
128+
129+
develocity-ccud-plugin-version:
130+
type: string
131+
132+
gradle-plugin-repository-url:
133+
type: string
134+
135+
gradle-plugin-repository-username:
136+
type: string
137+
138+
gradle-plugin-repository-password:
139+
type: string
140+
141+
# Wrapper validation configuration
142+
validate-wrappers:
143+
type: boolean
144+
145+
allow-snapshot-wrappers:
146+
type: boolean
147+
148+
# Deprecated action inputs
149+
arguments:
150+
type: string
151+
152+
# Experimental action inputs
153+
gradle-home-cache-strict-match:
154+
type: boolean
155+
156+
# Internal action inputs
157+
workflow-job-context:
158+
type: string
159+
160+
github-token:
161+
type: string
162+
163+
outputs:
164+
build-scan-url:
165+
type: string
166+
167+
dependency-graph-file:
168+
type: string
169+
170+
gradle-version:
171+
type: string
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Type descriptors based on https://github.com/typesafegithub/github-actions-typing
2+
inputs:
3+
min-wrapper-count:
4+
type: integer
5+
6+
allow-snapshots:
7+
type: boolean
8+
9+
allow-checksums:
10+
type: list
11+
separator: ','
12+
list-item:
13+
type: string
14+
15+
outputs:
16+
failed-wrapper:
17+
type: string

0 commit comments

Comments
 (0)