Skip to content

Commit 3bd66e2

Browse files
Add GitHub Actions output for schema ID after upload
1 parent 8bd1483 commit 3bd66e2

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/ContentProcessorAPI/samples/schemas/register_schema.ps1

Lines changed: 8 additions & 1 deletion
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"
@@ -104,4 +111,4 @@ foreach ($entry in $schemaEntries) {
104111

105112
# Clean up the temporary JSON file
106113
Remove-Item -Path $tempJson -Force
107-
}
114+
}

0 commit comments

Comments
 (0)