Skip to content

Commit 3f6f577

Browse files
Add GitHub Actions output support for schema ID in register_schema.ps1
1 parent 2793f9e commit 3f6f577

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/ContentProcessorAPI/samples/schemas/register_schema.ps1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ foreach ($entry in $schemaEntries) {
8686
$id = $responseJson.Id
8787
$desc = $responseJson.Description
8888
Write-Output "$desc's Schema Id - $id"
89+
90+
# Set GitHub Actions output if GITHUB_OUTPUT environment variable exists
91+
if ($env:GITHUB_OUTPUT) {
92+
# Create a safe variable name from the class name (lowercase, alphanumeric and underscores only)
93+
$safeName = $className.ToLower() -replace '[^a-z0-9_]', ''
94+
"${safeName}_schema_id=$id" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
95+
}
8996
}
9097
else {
9198
Write-Error "Failed to upload '$schemaFile'. HTTP Status: $httpStatusCode"

0 commit comments

Comments
 (0)