Skip to content

Commit

Permalink
#4017 - use MarkdownSnippets tool to embed .yml files as code snipp…
Browse files Browse the repository at this point in the history
…et in markdown
  • Loading branch information
arturcic committed Jul 18, 2024
1 parent b6772d1 commit d75cc93
Show file tree
Hide file tree
Showing 3 changed files with 613 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Markdown Update
on:
push:

env:
DOTNET_ROLL_FORWARD: "Major"
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: 1

defaults:
run:
shell: pwsh

jobs:
docs:
name: Update Markdown (embedded snippets)
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Run MarkdownSnippets
run: |
dotnet tool install --global MarkdownSnippets.Tool
mdsnippets --write-header false
working-directory: ${{ github.workspace }}/docs/input
-
name: Check for changes
id: status
run: |
if ($null -ne (git status --porcelain)) { echo "has_changes=1"; echo "has_changes=1" >> $env:GITHUB_OUTPUT }
-
name: Push changes
run: |
git add --verbose .
git config user.name 'Artur Stolear'
git config user.email 'artur.stolear@gmail.com'
git commit -m 'Docs changes' --allow-empty
git push --force
if: steps.status.outputs.has_changes == '1'
1 change: 1 addition & 0 deletions build/CI.sln
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
..\.github\workflows\_unit_tests.yml = ..\.github\workflows\_unit_tests.yml
..\.github\workflows\stale.yml = ..\.github\workflows\stale.yml
..\.github\workflows\winget.yml = ..\.github\workflows\winget.yml
..\.github\workflows\mkdocs.yml = ..\.github\workflows\mkdocs.yml
..\.github\dependabot.yml = ..\.github\dependabot.yml
EndProjectSection
EndProject
Expand Down
Loading

0 comments on commit d75cc93

Please sign in to comment.