-
-
Notifications
You must be signed in to change notification settings - Fork 80
90 lines (79 loc) · 3.48 KB
/
pr_linter_markdown.yml
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: "🎳 Markdown Linter"
# Trigger
on:
pull_request:
branches: [master]
paths:
- ".github/workflows/pr_linter_markdown.yml"
- "content/**/*.md"
permissions:
contents: read
pull-requests: write
statuses: write
jobs:
lint-markdown-review:
name: "👓 Vérification de la syntaxe"
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'geotribu' }}
steps:
- name: "Récupère le code source"
uses: actions/checkout@v4
# Filter results by added/modified lines.
- name: "Vérifie la syntaxe des lignes ajoutées ou modifiées"
id: markdownlint-github-pr-review-added
uses: reviewdog/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
fail_on_error: true
filter_mode: added
reporter: github-pr-review
- name: "Explications sur les erreurs du linter"
id: pr-comment-error-create
uses: marocchino/sticky-pull-request-comment@v2
if: ${{ failure() && steps.markdownlint-github-pr-review-added.conclusion == 'failure' && github.event.pull_request.head.repo.fork == false }}
with:
header: linter-md-error
recreate: true
message: |
Salut @${{ github.actor }}
Des erreurs de syntaxe Markdown ont été détectées dans les lignes ajoutées ou modifiées. Merci de les corriger ou de les marquer comme faux-positif :
- [règles de syntaxe Markdown applicables à Geotribu](https://contribuer.geotribu.fr/guides/markdown_quality/)
- [marquer une erreur de syntaxe comme faux-positif](https://contribuer.geotribu.fr/internal/markdown_linter/#gerer-les-faux-positifs-du-linter)
- [possibilités de rédaction offertes par le moteur Mkdocs + thème Material](https://squidfunk.github.io/mkdocs-material/reference/)
- name: "Marque le commentaire de félicitations comme résolu"
id: pr-comment-good-solve
uses: marocchino/sticky-pull-request-comment@v2
if: ${{ success() && github.event.pull_request.head.repo.fork == false }}
with:
header: linter-md-success
hide: true
hide_classify: "RESOLVED"
# # Filter results by added/modified file. i.e. reviewdog will report results
# # as long as they are in added/modified file even if the results are not in actual diff.
# - name: "Vérifie la syntaxe de tous les fichiers ajoutés ou modifiés"
# id: markdownlint-github-pr-review-file
# uses: reviewdog/[email protected]
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# fail_on_error: false
# filter_mode: file
# level: warning
# reporter: github-pr-review
# SUCCESS
- name: "Marque le commentaire d'erreur comme résolu"
id: pr-comment-error-solve
uses: marocchino/sticky-pull-request-comment@v2
if: ${{ success() && github.event.pull_request.head.repo.fork == false }}
with:
header: linter-md-error
hide: true
hide_classify: "RESOLVED"
- name: "Félicitations"
id: pr-comment-good
uses: marocchino/sticky-pull-request-comment@v2
if: ${{ success() && github.event.pull_request.head.repo.fork == false }}
with:
header: linter-md-success
recreate: true
message: |
:clap: Le markdown ajouté ou modifié est impeccable ! Merci :1st_place_medal: