Skip to content

Commit

Permalink
GitTools#4017 - use MarkdownSnippets tool to embed .yml files as co…
Browse files Browse the repository at this point in the history
…de snippet in markdown
  • Loading branch information
arturcic committed Jul 17, 2024
1 parent 790a607 commit 02187cf
Show file tree
Hide file tree
Showing 6 changed files with 631 additions and 10 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ jobs:
runs-on: ubuntu-latest
name: DotNet Format
steps:
- uses: actions/checkout@v4
-
name: Checkout
uses: actions/checkout@v4
-
name: Setup .NET SDK
uses: actions/setup-dotnet@v4
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
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:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Run MarkdownSnippets
run: |
dotnet tool install --global MarkdownSnippets.Tool
mdsnippets ${GITHUB_WORKSPACE}
-
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 '[email protected]'
git commit -m 'Docs changes' --allow-empty
git push --force
if: steps.status.outputs.has_changes == '1'
10 changes: 7 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@ jobs:
name: Trigger ci flow
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get version
-
name: Checkout
uses: actions/checkout@v4
-
name: Get version
id: get-version
shell: pwsh
run: |
# Finding the version from release tag
$VERSION="${{ github.ref }}".Replace("refs/tags/", "")
"version=$VERSION" >> $env:GITHUB_OUTPUT
- uses: peter-evans/repository-dispatch@v3
-
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
repository: ${{ github.repository }}
Expand Down
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 02187cf

Please sign in to comment.