File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Run on manual trigger and every day at 6:00 AM UTC
2+ on :
3+ workflow_dispatch :
4+ schedule :
5+ - cron : ' 0 6 * * *'
6+
7+ name : Run module with log analytics
8+
9+ jobs :
10+ run-psrule-monitor :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - uses : actions/checkout@v3
14+ name : Checkout
15+
16+ - name : Install PSRule
17+ run : |
18+ # Install-Module -Name PSRule -Force -Scope CurrentUser -SkipPublisherCheck
19+ Install-Module -Name PSRule.Monitor -Force -Scope CurrentUser -SkipPublisherCheck
20+
21+ - name : Run PSRule
22+ run : |
23+ Import-Module PSRule
24+ Import-Module PSRule.Monitor
25+ Import-Module ./src/PSRule.Rules.AzureDevOps/PSRule.Rules.AzureDevOps.psd1 -Force
26+ Connect-AzDevOps -Organization ${{ secrets.ADO_ORGANIZATION }} -PAT ${{ secrets.ADO_PAT }}
27+ New-Item -Path ./data -ItemType Directory -Force
28+ Export-AzDevOpsRuleData -Project ${{ secrets.ADO_PROJECT }} -OutputPath ./data
29+ $result = Invoke-PSRule -InputPath ./data/ `
30+ -Module "PSRule.Rules.AzureDevOps","PSRule.Monitor" `
31+ -Format Detect -Culture en
32+ $result | Send-PSRuleMonitorRecord -WorkspaceId $Env:PSRULE_CONFIGURATION_MONITOR_WORKSPACE_ID `
33+ -SharedKey $Env:PSRULE_CONFIGURATION_MONITOR_WORKSPACE_KEY -LogName RjbTest
34+ env :
35+ PSRULE_CONFIGURATION_MONITOR_WORKSPACE_ID : ${{ secrets.PSRULE_CONFIGURATION_MONITOR_WORKSPACE_ID }}
36+ PSRULE_CONFIGURATION_MONITOR_WORKSPACE_KEY : ${{ secrets.PSRULE_CONFIGURATION_MONITOR_WORKSPACE_KEY }}
37+ PSRULE_CONVENTION_INCLUDE : " Monitor.LogAnalytics.Import"
You can’t perform that action at this time.
0 commit comments