Skip to content

Commit f6747eb

Browse files
committed
Automatically update CloudFormation Resource Types compatibility in Wiki
1 parent 845e671 commit f6747eb

File tree

2 files changed

+52
-1
lines changed

2 files changed

+52
-1
lines changed

.github/workflows/wiki_sync.yaml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: sync wiki
2+
3+
on:
4+
push:
5+
branches: main
6+
7+
jobs:
8+
update-wiki:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout main
13+
uses: actions/checkout@v3
14+
15+
- name: Checkout wiki
16+
uses: actions/checkout@v3
17+
with:
18+
repository: "${{ github.repository }}.wiki"
19+
path: .wiki
20+
21+
- name: Update wiki pages
22+
run: (cd tools && ./generate-md-table-from-mappings) > .wiki/CloudFormation-Resource-Type-Compatibility.md
23+
24+
- name: Staging the changes
25+
working-directory: .wiki
26+
id: staging
27+
run: |
28+
git add .
29+
echo "CHANGES=$(git diff --staged --name-only | wc -l)" >> $GITHUB_OUTPUT
30+
31+
- name: Publish wiki
32+
working-directory: .wiki
33+
if: steps.staging.outputs.CHANGES > 0
34+
run: |
35+
git config user.name github-actions
36+
git config user.email [email protected]
37+
git commit -m "Automatic updates via GitHub action[.github/workflows/wiki_sync.yaml]"
38+
git push

tools/generate-md-table-from-mappings

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/bin/zsh
1+
#!/bin/bash
2+
echo "# Service Icons"
23
echo "| Resource Type | Icon title |"
34
echo "| --- | --- |"
45
cat ./make-definition-from-pptx-mappings | cut -d',' -f1 | cut -d':' -f1,2,3 | sort | uniq | while read line
@@ -8,3 +9,15 @@ do
89
echo "$title\` |"
910
[[ $? != 0 ]] && echo "$line"
1011
done
12+
13+
echo "# Resource Icons"
14+
echo "| Resource Type | Icon title |"
15+
echo "| --- | --- |"
16+
cat ./make-definition-from-pptx-mappings | grep "[A-z0-9]*::[A-z0-9]*::[A-z0-9]*" | cut -d',' -f1 | sort | uniq | while read line
17+
do
18+
echo -n "| \`$line\` | \`"
19+
title=$(cat ./make-definition-from-pptx-mappings | grep "$line," | cut -d',' -f2 | tr -d '[:cntrl:]')
20+
echo "$title\` |"
21+
[[ $? != 0 ]] && echo "$line"
22+
done
23+
exit 0

0 commit comments

Comments
 (0)