From 70e248622607582d0b94d6c8840e4f104719b110 Mon Sep 17 00:00:00 2001 From: James Garriss <52328727+james-garriss@users.noreply.github.com> Date: Wed, 20 Nov 2024 09:21:03 -0500 Subject: [PATCH 1/4] add workflow --- .github/workflows/convert_baselines.yaml | 50 ++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/convert_baselines.yaml diff --git a/.github/workflows/convert_baselines.yaml b/.github/workflows/convert_baselines.yaml new file mode 100644 index 0000000000..3302629e94 --- /dev/null +++ b/.github/workflows/convert_baselines.yaml @@ -0,0 +1,50 @@ +# 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 + permissions: + contents: write + 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=output/text/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=output/text/defender.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 output/html/aad.html + markdown-to-html --source PowerShell/ScubaGear/baselines/defender.md --output output/html/defender.html + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: output + path: output \ No newline at end of file From 9096e23c4211f8409004fb80dceaf6f44ba1a853 Mon Sep 17 00:00:00 2001 From: James Garriss <52328727+james-garriss@users.noreply.github.com> Date: Wed, 20 Nov 2024 09:26:22 -0500 Subject: [PATCH 2/4] fix paths --- .github/workflows/convert_baselines.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/convert_baselines.yaml b/.github/workflows/convert_baselines.yaml index 3302629e94..0efd53ef6e 100644 --- a/.github/workflows/convert_baselines.yaml +++ b/.github/workflows/convert_baselines.yaml @@ -27,7 +27,7 @@ jobs: -f markdown -t plain PowerShell/ScubaGear/baselines/aad.md - --output=output/text/aad.txt + --output=baselines/aad.txt - name: Convert Defender to Text uses: docker://pandoc/core:3.5 with: @@ -36,15 +36,15 @@ jobs: -f markdown -t plain PowerShell/ScubaGear/baselines/defender.md - --output=output/text/defender.txt + --output=baselines/defender.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 output/html/aad.html - markdown-to-html --source PowerShell/ScubaGear/baselines/defender.md --output output/html/defender.html + 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 - name: Upload uses: actions/upload-artifact@v4 with: name: output - path: output \ No newline at end of file + path: baselines From 3d42d7acc4a39c45ae09e5cbf72bba5c157fa845 Mon Sep 17 00:00:00 2001 From: James Garriss <52328727+james-garriss@users.noreply.github.com> Date: Wed, 20 Nov 2024 09:33:31 -0500 Subject: [PATCH 3/4] test write permissions --- .github/workflows/convert_baselines.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/convert_baselines.yaml b/.github/workflows/convert_baselines.yaml index 0efd53ef6e..22e2fe0157 100644 --- a/.github/workflows/convert_baselines.yaml +++ b/.github/workflows/convert_baselines.yaml @@ -8,14 +8,14 @@ on: paths: - ".github/workflows/convert_baselines.yaml" -# permissions: read-all +permissions: read-all jobs: convert: name: Convert runs-on: ubuntu-latest - permissions: - contents: write + # permissions: + # contents: write steps: - name: Checkout Repo uses: actions/checkout@v4 From f8d3fbc22ffb3eb72d3f81f6a437665047af1a0b Mon Sep 17 00:00:00 2001 From: James Garriss <52328727+james-garriss@users.noreply.github.com> Date: Wed, 20 Nov 2024 09:50:10 -0500 Subject: [PATCH 4/4] add remaining baseline files --- .github/workflows/convert_baselines.yaml | 52 +++++++++++++++++++++++- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/.github/workflows/convert_baselines.yaml b/.github/workflows/convert_baselines.yaml index 22e2fe0157..05ee5870b5 100644 --- a/.github/workflows/convert_baselines.yaml +++ b/.github/workflows/convert_baselines.yaml @@ -14,8 +14,6 @@ jobs: convert: name: Convert runs-on: ubuntu-latest - # permissions: - # contents: write steps: - name: Checkout Repo uses: actions/checkout@v4 @@ -37,12 +35,62 @@ jobs: -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: