Skip to content

Commit 83c83f1

Browse files
authored
Collect typing differences into list (#136)
The goal is to facilitate creation of PRs after all actions are analyzed.
1 parent e3aad7c commit 83c83f1

3 files changed

Lines changed: 23 additions & 14 deletions

File tree

.github/workflows/test.main.kts

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,14 @@ private data class ActionCoords(
124124
val pathToTypings: String,
125125
)
126126

127+
private data class TypingDifference(
128+
val action: ActionCoords,
129+
val extraInputsInManifest: Set<String>,
130+
val extraInputsInTypings: Set<String>,
131+
val extraOutputsInManifest: Set<String>,
132+
val extraOutputsInTypings: Set<String>,
133+
)
134+
127135
private fun validateTypings(sha: String, baseRef: String?) {
128136
val typingsSchema = JsonSchema.fromDefinition(
129137
URI.create("https://raw.githubusercontent.com/typesafegithub/github-actions-typing/" +
@@ -140,6 +148,8 @@ private fun validateTypings(sha: String, baseRef: String?) {
140148

141149
var shouldFail = false
142150

151+
val typingDifferences = mutableListOf<TypingDifference>()
152+
143153
for (action in actions) {
144154
println()
145155
println("\uFE0F For https://github.com/${action.owner}/${action.name}/tree/${action.version}/${action.path ?: ""}")
@@ -181,18 +191,17 @@ private fun validateTypings(sha: String, baseRef: String?) {
181191

182192
if (typingsInputs != manifestInputs || typingsOutputs != manifestOutputs) {
183193
println("\uD83D\uDD34 Something is wrong with the typings!")
184-
(typingsInputs - manifestInputs).let {
185-
if (it.isNotEmpty()) { println("Extra inputs in typings: $it") }
186-
}
187-
(manifestInputs - typingsInputs).let {
188-
if (it.isNotEmpty()) { println("Extra inputs in manifest: $it") }
189-
}
190-
(typingsOutputs - manifestOutputs).let {
191-
if (it.isNotEmpty()) { println("Extra outputs in typings: $it") }
192-
}
193-
(manifestOutputs - typingsOutputs).let {
194-
if (it.isNotEmpty()) { println("Extra outputs in manifest: $it") }
195-
}
194+
195+
val difference = TypingDifference(
196+
action = action,
197+
extraInputsInManifest = manifestInputs - typingsInputs,
198+
extraInputsInTypings = typingsInputs - manifestInputs,
199+
extraOutputsInManifest = manifestOutputs - typingsOutputs,
200+
extraOutputsInTypings = typingsOutputs - manifestOutputs
201+
)
202+
println(difference)
203+
204+
typingDifferences += difference
196205
shouldFail = true
197206
continue
198207
}

typings/actions/checkout/v6/action-types.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ inputs:
1212
type: string
1313
ssh-strict:
1414
type: boolean
15-
persist-credentials:
16-
type: boolean
1715
path:
1816
type: string
1917
clean:

typings/actions/create-release/v1/action-types.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ inputs:
1212
type: boolean
1313
prerelease:
1414
type: boolean
15+
boogaa:
16+
type: string
1517
commitish:
1618
type: string
1719
owner:

0 commit comments

Comments
 (0)