-
Notifications
You must be signed in to change notification settings - Fork 240
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 1454-pipeline-does-not-fail-on-pester-fail
- Loading branch information
Showing
63 changed files
with
14,102 additions
and
21,537 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,98 @@ | ||
# Purpose: Converts the baseline Markdown files into HTML and text so that they can be ingested into Drupal. | ||
|
||
name: Convert Baseline to Text and HTML | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
paths: | ||
- ".github/workflows/convert_baselines.yaml" | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
convert: | ||
name: Convert | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
- name: Convert AAD to Text | ||
uses: docker://pandoc/core:3.5 | ||
with: | ||
args: >- | ||
--standalone | ||
-f markdown | ||
-t plain | ||
PowerShell/ScubaGear/baselines/aad.md | ||
--output=baselines/aad.txt | ||
- name: Convert Defender to Text | ||
uses: docker://pandoc/core:3.5 | ||
with: | ||
args: >- | ||
--standalone | ||
-f markdown | ||
-t plain | ||
PowerShell/ScubaGear/baselines/defender.md | ||
--output=baselines/defender.txt | ||
- name: Convert Exchange to Text | ||
uses: docker://pandoc/core:3.5 | ||
with: | ||
args: >- | ||
--standalone | ||
-f markdown | ||
-t plain | ||
PowerShell/ScubaGear/baselines/exo.md | ||
--output=baselines/exo.txt | ||
- name: Convert Power BI to Text | ||
uses: docker://pandoc/core:3.5 | ||
with: | ||
args: >- | ||
--standalone | ||
-f markdown | ||
-t plain | ||
PowerShell/ScubaGear/baselines/powerbi.md | ||
--output=baselines/powerbi.txt | ||
- name: Convert Power Platform to Text | ||
uses: docker://pandoc/core:3.5 | ||
with: | ||
args: >- | ||
--standalone | ||
-f markdown | ||
-t plain | ||
PowerShell/ScubaGear/baselines/powerplatform.md | ||
--output=baselines/powerflatform.txt | ||
- name: Convert Sharepoint to Text | ||
uses: docker://pandoc/core:3.5 | ||
with: | ||
args: >- | ||
--standalone | ||
-f markdown | ||
-t plain | ||
PowerShell/ScubaGear/baselines/sharepoint.md | ||
--output=baselines/sharepoint.txt | ||
- name: Convert Teams to Text | ||
uses: docker://pandoc/core:3.5 | ||
with: | ||
args: >- | ||
--standalone | ||
-f markdown | ||
-t plain | ||
PowerShell/ScubaGear/baselines/teams.md | ||
--output=baselines/teams.txt | ||
- name: Install HTML converter | ||
run: npm i markdown-to-html-cli -g | ||
- name: Convert to HTML | ||
run: | | ||
markdown-to-html --source PowerShell/ScubaGear/baselines/aad.md --output baselines/aad.html | ||
markdown-to-html --source PowerShell/ScubaGear/baselines/defender.md --output baselines/defender.html | ||
markdown-to-html --source PowerShell/ScubaGear/baselines/exo.md --output baselines/exo.html | ||
markdown-to-html --source PowerShell/ScubaGear/baselines/powerbi.md --output baselines/powerbi.html | ||
markdown-to-html --source PowerShell/ScubaGear/baselines/powerplatform.md --output baselines/powerplatform.html | ||
markdown-to-html --source PowerShell/ScubaGear/baselines/sharepoint.md --output baselines/sharepoint.html | ||
markdown-to-html --source PowerShell/ScubaGear/baselines/teams.md --output baselines/teams.html | ||
- name: Upload | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: output | ||
path: baselines |
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,45 @@ | ||
function Invoke-CheckScubaGearVersionPSGallery { | ||
|
||
# Retrieve the installed version of ScubaGear from the system | ||
$InstalledModule = Get-Module -Name ScubaGear -ListAvailable -ErrorAction 'Stop' | ||
if ($InstalledModule) { | ||
$CurrentVersion = [System.Version]$InstalledModule.Version | ||
} else { | ||
# If we are here, ScubaGear is not installed from PSGallery. | ||
# Or it may have been installed a different way in a nonstandard folder, | ||
# or is running in an extracted release folder. Check github instead. | ||
return Invoke-CheckScubaGearVersionGithub -ErrorAction 'Stop' | ||
} | ||
|
||
# Retrieve the latest version from PowerShell Gallery | ||
$ModuleInfo = Find-Module -Name ScubaGear -ErrorAction 'Stop' | ||
$LatestVersion = [System.Version]$ModuleInfo.Version | ||
|
||
if ($CurrentVersion -lt $LatestVersion) { | ||
Write-Warning "A new version of ScubaGear ($LatestVersion) is available on PowerShell Gallery. This notification can be disabled by setting `$env:SCUBAGEAR_SKIP_VERSION_CHECK = `$true before running ScubaGear." | ||
|
||
} | ||
|
||
# Store the current time in the file to mark the last check time | ||
(Get-Date -ErrorAction 'Stop').ToString() | Set-Content $VersionCheckFile -ErrorAction 'Stop' | ||
} | ||
|
||
|
||
function Invoke-CheckScubaGearVersionGithub { | ||
$ScubaManifest = Import-PowerShellDataFile (Join-Path -Path $PSScriptRoot -ChildPath 'ScubaGear.psd1' -Resolve -ErrorAction 'Stop' ) -ErrorAction 'Stop' | ||
$CurrentVersion = $ScubaManifest.ModuleVersion | ||
$LatestVersion = $(Invoke-RestMethod -Uri "https://api.github.com/repos/cisagov/ScubaGear/releases/latest" -ErrorAction 'Stop').tag_name.TrimStart("v") | ||
if ($CurrentVersion -ne $LatestVersion) { | ||
Write-Warning "A new version of ScubaGear ($latestVersion) is available. Please consider updating at: https://github.com/cisagov/ScubaGear/releases. This notification can be disabled by setting `$env:SCUBAGEAR_SKIP_VERSION_CHECK = `$true before running ScubaGear." | ||
} | ||
} | ||
|
||
# Do the version check if the skip envvar is not defined. | ||
if ([string]::IsNullOrWhiteSpace($env:SCUBAGEAR_SKIP_VERSION_CHECK)) { | ||
try { | ||
Invoke-CheckScubaGearVersionPSGallery -ErrorAction 'Stop' | ||
} | ||
catch { | ||
Write-Warning "The ScubaGear version check failed to execute. This notification can be disabled by setting `$env:SCUBAGEAR_SKIP_VERSION_CHECK = `$true.`n$($_.Exception.Message)`n$($_.ScriptStackTrace)" | ||
} | ||
} |
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.