Repository: typesafegithub/github-workflows-kt (kotlin)

Issue:
New major versions of actions available
new version(s) available: [v7] for actions/github-script@v6

Pull request:
Closes #1100.

Patch:
diff --git a/actions/actions/github-script/v7/action-types.yml b/actions/actions/github-script/v7/action-types.yml
new file mode 100644
index 0000000000..c06c4a0413
--- /dev/null
+++ b/actions/actions/github-script/v7/action-types.yml
@@ -0,0 +1,32 @@
+# See https://github.com/typesafegithub/github-actions-typing
+inputs:
+  script:
+    type: string
+  github-token:
+    type: string
+  debug:
+    type: boolean
+  user-agent:
+    type: string
+  previews:
+    type: list
+    separator: ','
+    list-item:
+      type: string
+  result-encoding:
+    type: enum
+    name: Encoding
+    allowed-values:
+    - string
+    - json
+  retries:
+    type: integer
+  retry-exempt-status-codes:
+    type: list
+    separator: ','
+    list-item:
+      type: integer
+# Please check those outputs's description and set a proper type. 'string' is just set by default
+outputs:
+  result:
+    type: string
diff --git a/actions/actions/github-script/v7/commit-hash.txt b/actions/actions/github-script/v7/commit-hash.txt
new file mode 100644
index 0000000000..2e7c9ab1bc
--- /dev/null
+++ b/actions/actions/github-script/v7/commit-hash.txt
@@ -0,0 +1,1 @@
+e69ef5462fd455e02edcaf4dd7708eda96b9eda0
\ No newline at end of file
diff --git a/docs/supported-actions.md b/docs/supported-actions.md
index a223c5fb08..903ae5aaf1 100644
--- a/docs/supported-actions.md
+++ b/docs/supported-actions.md
@@ -20,7 +20,7 @@ Click on a version to see the binding's code.
     * [create-release](https://github.com/actions/create-release) - v1: [`CreateReleaseV1`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/CreateReleaseV1.kt)
     * [download-artifact](https://github.com/actions/download-artifact) - v2: [`DownloadArtifactV2`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/DownloadArtifactV2.kt), v3: [`DownloadArtifactV3`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/DownloadArtifactV3.kt)
     * [first-interaction](https://github.com/actions/first-interaction) - v1: [`FirstInteractionV1`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/FirstInteractionV1.kt)
-    * [github-script](https://github.com/actions/github-script) - v6: [`GithubScriptV6`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/GithubScriptV6.kt)
+    * [github-script](https://github.com/actions/github-script) - v6: [`GithubScriptV6`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/GithubScriptV6.kt), v7: [`GithubScriptV7`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/GithubScriptV7.kt)
     * [labeler](https://github.com/actions/labeler) - v4: [`LabelerV4`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/LabelerV4.kt)
     * [setup-dotnet](https://github.com/actions/setup-dotnet) - v2: [`SetupDotnetV2`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/SetupDotnetV2.kt), v3: [`SetupDotnetV3`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/SetupDotnetV3.kt)
     * [setup-go](https://github.com/actions/setup-go) - v3: [`SetupGoV3`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/SetupGoV3.kt), v4: [`SetupGoV4`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/SetupGoV4.kt)
@@ -138,6 +138,6 @@ Click on a version to see the binding's code.
 Number of bindings available:
 
 * counting by actions: 82
-* counting each version separately: 130
+* counting each version separately: 131
 
 Actions [providing typings](https://github.com/typesafegithub/github-actions-typing/) (marked with ✅ on the above list): 15
diff --git a/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/GithubScriptV6.kt b/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/GithubScriptV6.kt
index 894453c5f0..5dfa2a4316 100644
--- a/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/GithubScriptV6.kt
+++ b/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/GithubScriptV6.kt
@@ -4,6 +4,7 @@
 @file:Suppress(
     "DataClassPrivateConstructor",
     "UNUSED_PARAMETER",
+    "DEPRECATION",
 )
 
 package io.github.typesafegithub.workflows.actions.actions
@@ -12,6 +13,7 @@ import io.github.typesafegithub.workflows.domain.actions.Action
 import io.github.typesafegithub.workflows.domain.actions.RegularAction
 import java.util.LinkedHashMap
 import kotlin.Boolean
+import kotlin.Deprecated
 import kotlin.Int
 import kotlin.String
 import kotlin.Suppress
@@ -28,6 +30,10 @@ import kotlin.collections.toTypedArray
  *
  * [Action on GitHub](https://github.com/actions/github-script)
  */
+@Deprecated(
+    message = "This action has a newer major version: GithubScriptV7",
+    replaceWith = ReplaceWith("GithubScriptV7"),
+)
 public data class GithubScriptV6 private constructor(
     /**
      * The script to run
diff --git a/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/GithubScriptV7.kt b/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/GithubScriptV7.kt
new file mode 100644
index 0000000000..b28e4399dc
--- /dev/null
+++ b/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/GithubScriptV7.kt
@@ -0,0 +1,138 @@
+// This file was generated using action-binding-generator. Don't change it by hand, otherwise your
+// changes will be overwritten with the next binding code regeneration.
+// See https://github.com/typesafegithub/github-workflows-kt for more info.
+@file:Suppress(
+    "DataClassPrivateConstructor",
+    "UNUSED_PARAMETER",
+)
+
+package io.github.typesafegithub.workflows.actions.actions
+
+import io.github.typesafegithub.workflows.domain.actions.Action
+import io.github.typesafegithub.workflows.domain.actions.RegularAction
+import java.util.LinkedHashMap
+import kotlin.Boolean
+import kotlin.Int
+import kotlin.String
+import kotlin.Suppress
+import kotlin.Unit
+import kotlin.collections.List
+import kotlin.collections.Map
+import kotlin.collections.toList
+import kotlin.collections.toTypedArray
+
+/**
+ * Action: GitHub Script
+ *
+ * Run simple scripts using the GitHub client
+ *
+ * [Action on GitHub](https://github.com/actions/github-script)
+ */
+public data class GithubScriptV7 private constructor(
+    /**
+     * The script to run
+     */
+    public val script: String,
+    /**
+     * The GitHub token used to create an authenticated client
+     */
+    public val githubToken: String? = null,
+    /**
+     * Whether to tell the GitHub client to log details of its requests. true or false. Default is
+     * to run in debug mode when the GitHub Actions step debug logging is turned on.
+     */
+    public val debug: Boolean? = null,
+    /**
+     * An optional user-agent string
+     */
+    public val userAgent: String? = null,
+    /**
+     * A comma-separated list of GraphQL API previews to accept
+     */
+    public val previews: List<String>? = null,
+    /**
+     * Either "string" or "json" (default "json")—how the result will be encoded
+     */
+    public val resultEncoding: GithubScriptV7.Encoding? = null,
+    /**
+     * The number of times to retry a request
+     */
+    public val retries: Int? = null,
+    /**
+     * A comma separated list of status codes that will NOT be retried e.g. "400,500". No effect
+     * unless `retries` is set
+     */
+    public val retryExemptStatusCodes: List<Int>? = null,
+    /**
+     * An optional GitHub REST API URL to connect to a different GitHub instance. For example,
+     * https://my.github-enterprise-server.com/api/v3
+     */
+    public val baseUrl: String? = null,
+    /**
+     * Type-unsafe map where you can put any inputs that are not yet supported by the binding
+     */
+    public val _customInputs: Map<String, String> = mapOf(),
+    /**
+     * Allows overriding action's version, for example to use a specific minor version, or a newer
+     * version that the binding doesn't yet know about
+     */
+    public val _customVersion: String? = null,
+) : RegularAction<GithubScriptV7.Outputs>("actions", "github-script", _customVersion ?: "v7") {
+    public constructor(
+        vararg pleaseUseNamedArguments: Unit,
+        script: String,
+        githubToken: String? = null,
+        debug: Boolean? = null,
+        userAgent: String? = null,
+        previews: List<String>? = null,
+        resultEncoding: GithubScriptV7.Encoding? = null,
+        retries: Int? = null,
+        retryExemptStatusCodes: List<Int>? = null,
+        baseUrl: String? = null,
+        _customInputs: Map<String, String> = mapOf(),
+        _customVersion: String? = null,
+    ) : this(script=script, githubToken=githubToken, debug=debug, userAgent=userAgent,
+            previews=previews, resultEncoding=resultEncoding, retries=retries,
+            retryExemptStatusCodes=retryExemptStatusCodes, baseUrl=baseUrl,
+            _customInputs=_customInputs, _customVersion=_customVersion)
+
+    @Suppress("SpreadOperator")
+    override fun toYamlArguments(): LinkedHashMap<String, String> = linkedMapOf(
+        *listOfNotNull(
+            "script" to script,
+            githubToken?.let { "github-token" to it },
+            debug?.let { "debug" to it.toString() },
+            userAgent?.let { "user-agent" to it },
+            previews?.let { "previews" to it.joinToString(",") },
+            resultEncoding?.let { "result-encoding" to it.stringValue },
+            retries?.let { "retries" to it.toString() },
+            retryExemptStatusCodes?.let { "retry-exempt-status-codes" to it.joinToString(",") {
+                    it.toString() } },
+            baseUrl?.let { "base-url" to it },
+            *_customInputs.toList().toTypedArray(),
+        ).toTypedArray()
+    )
+
+    override fun buildOutputObject(stepId: String): Outputs = Outputs(stepId)
+
+    public sealed class Encoding(
+        public val stringValue: kotlin.String,
+    ) {
+        public object String : GithubScriptV7.Encoding("string")
+
+        public object Json : GithubScriptV7.Encoding("json")
+
+        public class Custom(
+            customStringValue: kotlin.String,
+        ) : GithubScriptV7.Encoding(customStringValue)
+    }
+
+    public class Outputs(
+        stepId: String,
+    ) : Action.Outputs(stepId) {
+        /**
+         * The return value of the script, stringified with `JSON.stringify`
+         */
+        public val result: String = "steps.$stepId.outputs.result"
+    }
+}


Test patch:
diff --git a/.github/workflows/Integration tests - job outputs mapping.yaml b/.github/workflows/Integration tests - job outputs mapping.yaml
index b55afdc433..c63a58220a 100644
--- a/.github/workflows/Integration tests - job outputs mapping.yaml
+++ b/.github/workflows/Integration tests - job outputs mapping.yaml
@@ -15,7 +15,7 @@ jobs:
       scriptResult: '${{ steps.step-0.outputs.result }}'
     steps:
     - id: 'step-0'
-      uses: 'actions/github-script@v6'
+      uses: 'actions/github-script@v7'
       with:
         script: |-
           core.setOutput("key", "value")
diff --git a/library/src/test/kotlin/io/github/typesafegithub/workflows/IntegrationTest.kt b/library/src/test/kotlin/io/github/typesafegithub/workflows/IntegrationTest.kt
index 76be87612e..0c919836e5 100644
--- a/library/src/test/kotlin/io/github/typesafegithub/workflows/IntegrationTest.kt
+++ b/library/src/test/kotlin/io/github/typesafegithub/workflows/IntegrationTest.kt
@@ -1,7 +1,7 @@
 package io.github.typesafegithub.workflows
 
 import io.github.typesafegithub.workflows.actions.actions.CheckoutV4
-import io.github.typesafegithub.workflows.actions.actions.GithubScriptV6
+import io.github.typesafegithub.workflows.actions.actions.GithubScriptV7
 import io.github.typesafegithub.workflows.actions.actions.SetupPythonV4
 import io.github.typesafegithub.workflows.actions.awsactions.ConfigureAwsCredentialsV4
 import io.github.typesafegithub.workflows.actions.endbug.AddAndCommitV9
@@ -844,7 +844,7 @@ class IntegrationTest : FunSpec({
                     val scriptStep =
                         uses(
                             action =
-                                GithubScriptV6(
+                                GithubScriptV7(
                                     script =
                                         """
                                         core.setOutput("key", "value")