Skip to content

Commit 3b1aa05

Browse files
committed
#4017 - use MarkdownSnippets tool to embed .yml files as code snippet in markdown
1 parent b6772d1 commit 3b1aa05

File tree

3 files changed

+613
-0
lines changed

3 files changed

+613
-0
lines changed

.github/workflows/mkdocs.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Markdown Update
2+
on:
3+
push:
4+
5+
env:
6+
DOTNET_ROLL_FORWARD: "Major"
7+
DOTNET_CLI_TELEMETRY_OPTOUT: 1
8+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
9+
DOTNET_NOLOGO: 1
10+
11+
defaults:
12+
run:
13+
shell: pwsh
14+
15+
jobs:
16+
docs:
17+
name: Update Markdown (embedded snippets)
18+
runs-on: ubuntu-latest
19+
steps:
20+
-
21+
name: Checkout
22+
uses: actions/checkout@v4
23+
-
24+
name: Run MarkdownSnippets
25+
run: |
26+
dotnet tool install --global MarkdownSnippets.Tool
27+
mdsnippets --write-header false
28+
working-directory: ${{ github.workspace }}/docs/input
29+
-
30+
name: Check for changes
31+
id: status
32+
run: |
33+
if ($null -ne (git status --porcelain)) { echo "has_changes=1"; echo "has_changes=1" >> $env:GITHUB_OUTPUT }
34+
-
35+
name: Push changes
36+
run: |
37+
git add --verbose .
38+
git config user.name 'Artur Stolear'
39+
git config user.email '[email protected]'
40+
git commit -m 'Docs changes' --allow-empty
41+
git push --force
42+
if: steps.status.outputs.has_changes == '1'

build/CI.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
4242
..\.github\workflows\_unit_tests.yml = ..\.github\workflows\_unit_tests.yml
4343
..\.github\workflows\stale.yml = ..\.github\workflows\stale.yml
4444
..\.github\workflows\winget.yml = ..\.github\workflows\winget.yml
45+
..\.github\workflows\mkdocs.yml = ..\.github\workflows\mkdocs.yml
4546
..\.github\dependabot.yml = ..\.github\dependabot.yml
4647
EndProjectSection
4748
EndProject

0 commit comments

Comments
 (0)