-
Notifications
You must be signed in to change notification settings - Fork 10
49 lines (49 loc) · 1.74 KB
/
publish-checks-wiki.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
name: Publish checks to wiki
on:
push:
branches: [develop]
paths:
- .github/workflows/publish-checks-wiki.yml
- magik-checks/src/main/resources/nl/ramsolutions/sw/sonar/l10n/magik/rules/*.html
concurrency:
group: publish-checks-wiki
cancel-in-progress: true
permissions:
contents: write
jobs:
publish-wiki:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
python3 -m pip install --upgrade pip
python3 -m pip install html2text==2024.2.26
- run: |
mkdir -p wiki/checks
- run: |
for f in magik-checks/src/main/resources/nl/ramsolutions/sw/sonar/l10n/magik/rules/*.html
do
name=$(basename $f .html)
path=wiki/checks/Check-$name.md
echo "Generating $path"
html2text -b 0 $f > $path
echo "" >> $path
echo "NOTE: This page is generated. Any changes made to this page through the wiki will be lost in the future." >> $path
done
- run: |
path=wiki/checks/Checks-Index.md
echo "Checks available:" > $path
for f in magik-checks/src/main/resources/nl/ramsolutions/sw/sonar/l10n/magik/rules/*.html
do
name=$(basename $f .html)
wikipage=Check-$name
echo "" >> $path
echo "[[$name|$wikipage]]" >> $path
done
echo "" >> $path
echo "NOTE: This page is generated. Any changes made to this page through the wiki will be lost in the future." >> $path
- uses: Andrew-Chen-Wang/github-wiki-action@86138cbd6328b21d759e89ab6e6dd6a139b22270
with:
path: wiki
#dry-run: true
if: ${{ github.repository_owner == 'StevenLooman' }}