-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into rosanto-adding-cognitive-services
- Loading branch information
Showing
113 changed files
with
9,558 additions
and
960 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
install-module powershell-yaml -force -scope currentuser | ||
|
||
function Build-APRLJsonObject { | ||
param ( | ||
[string]$path | ||
) | ||
|
||
$kqlfiles = Get-ChildItem -Path $path -Recurse -Filter "*.kql" | ||
$yamlfiles = Get-ChildItem -Path $path -Recurse -Filter "*.yaml" | ||
|
||
$yamlobj = foreach($file in $yamlfiles){ | ||
$content = Get-Content $file.FullName -Raw | ConvertFrom-Yaml | ||
$content | Select-Object publishedToAdvisor,aprlGuid,recommendationTypeId,recommendationMetadataState,learnMoreLink,recommendationControl,longDescription,pgVerified,description,potentialBenefits,publishedToLearn,tags,recommendationResourceType,recommendationImpact,automationAvailable,query | ||
} | ||
|
||
$kqlobj = foreach($file in $kqlfiles){ | ||
$content = Get-Content $file.FullName -Raw | ||
[PSCustomObject]@{ | ||
AprlGUID = $file.Name -replace ".kql","" | ||
Query = $content | ||
} | ||
} | ||
|
||
$aprlobj = foreach($obj in $yamlobj){ | ||
$obj.query = $($kqlobj.Where{$_.AprlGUID -eq $obj.aprlGuid}).Query | ||
$obj | ||
} | ||
return $aprlobj | ||
} | ||
|
||
#Try to build and export the object. If it fails, catch the error and exit with code 1 | ||
try{ | ||
Build-APRLJsonObject -path "./azure-resources" | ConvertTo-Json -Depth 10 | Out-File -FilePath "./tools/data/recommendations.json" -Force | ||
exit 0 | ||
} | ||
catch{ | ||
Write-Error $_.Exception.Message | ||
exit 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Nightly Recommendation Object Build | ||
|
||
on: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: main | ||
|
||
- name: Run Recommendation Object Builder | ||
run: | | ||
pwsh .github/scripts/build-recommendation-object.ps1 | ||
- name: Commit and push changes | ||
run: | | ||
git config --global user.name 'github-actions[bot]' | ||
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | ||
git add ./tools/data/recommendations.json | ||
git commit -m "Update recommendations.json" | ||
git push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.