-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathConvertGuidelinesXmlToMarkdown.yml
More file actions
58 lines (49 loc) · 1.9 KB
/
ConvertGuidelinesXmlToMarkdown.yml
File metadata and controls
58 lines (49 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#if the guidelines xml file is modified between commits to the master branch the associate markdown file is updated
name: Update csharp Markdown
on:
push:
branches:
- 'main'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
env:
XmlFileName: "Guidelines(8th Edition).xml"
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.ref }}
token: ${{ secrets.CI_PAT }}
- name: Simple Diff
uses: mudlabs/simple-diff@v1.2.0
id: diff
with:
# The path of the file or folder to find in the commits diff tree.
path: ./docs/${{ env.XmlFileName }}
# continue even if the xml file if the file isn't found in the diff tree (it wasn't changed). strict=true causes the action to fail otherwise
strict : false
- name: Guidelines xml status
run: |
echo "${{ env.XmlFileName }} modified = ${{ steps.diff.outputs.modified }}"
echo "${{ steps.diff.outputs.name }}"
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
5.0.x
6.0.x
if: ${{ steps.diff.outputs.modified == 'true' }}
- name: restore_compile_run_createMD
run: >
dotnet run --configuration Release --project ./Tools/XMLtoMD/GuidelineXmlToMD/GuidelineXmlToMD.csproj
-- --xml-input-file "./docs/${{ env.XmlFileName }}" --markdown-output-file "./docs/coding/csharp.md"
if: ${{ steps.diff.outputs.modified == 'true' }}
- name: Create commit and push to CodingGuideLinesMDUpdate
run: |
git config user.name '${{ github.actor }}'
git config user.email '${{ github.actor }}@users.noreply.github.com'
git add -A
git commit -m "new coding guidelines MD File created"
git push origin '${{ github.ref }}'
if: ${{ steps.diff.outputs.modified == 'true' }}