Skip to content

Commit e043744

Browse files
authored
job
1 parent 812e56a commit e043744

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Validate and Fix Markdown
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
validate-and-fix-markdown:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Set up Node.js
23+
uses: actions/setup-node@v3
24+
with:
25+
node-version: '16'
26+
27+
- name: Install Markdown Linter
28+
run: npm install -g markdownlint-cli
29+
30+
- name: Lint and Fix Markdown files
31+
run: markdownlint '**/*.md' --fix --config .github/.markdownlint.json --ignore GPT-RAG_SolutionAccelerator/
32+
33+
- name: Configure Git
34+
run: |
35+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
36+
git config --global user.name "github-actions[bot]"
37+
38+
- name: Commit and rebase changes
39+
env:
40+
PR_BRANCH: ${{ github.head_ref || github.ref_name }}
41+
run: |
42+
git add -A
43+
git commit -m "Fix Markdown syntax issues" || echo "No changes to commit"
44+
git pull --rebase origin "$PR_BRANCH" || echo "No rebase needed"
45+
git push origin HEAD:"$PR_BRANCH"

0 commit comments

Comments
 (0)