Skip to content

Commit 0a1748c

Browse files
committed
GitTools#4017 - use MarkdownSnippets tool to embed .yml files as code snippet in markdown
1 parent 9ea1b88 commit 0a1748c

File tree

6 files changed

+632
-10
lines changed

6 files changed

+632
-10
lines changed

.github/workflows/format.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ jobs:
3737
runs-on: ubuntu-latest
3838
name: DotNet Format
3939
steps:
40-
- uses: actions/checkout@v4
40+
-
41+
name: Checkout
42+
uses: actions/checkout@v4
4143
-
4244
name: Setup .NET SDK
4345
uses: actions/setup-dotnet@v4

.github/workflows/mkdocs.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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 ${GITHUB_WORKSPACE}
28+
-
29+
name: Check for changes
30+
id: status
31+
run: |
32+
if ($null -ne (git status --porcelain)) { echo "has_changes=1"; echo "has_changes=1" >> $env:GITHUB_OUTPUT }
33+
-
34+
name: Push changes
35+
run: |
36+
git add --verbose .
37+
git config user.name 'Artur Stolear'
38+
git config user.email '[email protected]'
39+
git commit -m 'Docs changes' --allow-empty
40+
git push --force
41+
if: steps.status.outputs.has_changes == '1'

.github/workflows/release.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,19 @@ jobs:
88
name: Trigger ci flow
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v4
12-
- name: Get version
11+
-
12+
name: Checkout
13+
uses: actions/checkout@v4
14+
-
15+
name: Get version
1316
id: get-version
1417
shell: pwsh
1518
run: |
1619
# Finding the version from release tag
1720
$VERSION="${{ github.ref }}".Replace("refs/tags/", "")
1821
"version=$VERSION" >> $env:GITHUB_OUTPUT
19-
- uses: peter-evans/repository-dispatch@v3
22+
-
23+
uses: peter-evans/repository-dispatch@v3
2024
with:
2125
token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
2226
repository: ${{ github.repository }}

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)