-
Notifications
You must be signed in to change notification settings - Fork 26
48 lines (48 loc) · 1.5 KB
/
plantuml.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
name: Generate PlantUML Diagrams
on:
pull_request:
paths:
- '**.puml'
push:
paths:
- '**.puml'
jobs:
ci:
runs-on: ubuntu-latest
env:
UML_FILES: ".puml"
steps:
- name: Checkout Source
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get changed UML files
id: getfile
run: |
git diff-tree -r --no-commit-id --summary ${{ github.sha }} \
| awk -F' ' '{
# ensure we are not trying to process deleted files
# only process puml files
# do not try to process our theme or custom config
if ( $1 !~ /^delete$/ && $4 ~ /\.puml$/ && $4 !~ /(theme|config)\.puml$/ )
{
# only print the file name and strip newlines for spaces
printf "::set-output name=files::" "%s ", $4
}
}
END { print "" } # ensure we do print a newline at the end
'
- name: UML files considered echo output
run: |
echo ${{ steps.getfile.outputs.files }}
- name: Generate PNG Diagrams
uses: cloudbees/plantuml-github-action@master
continue-on-error: true
with:
args: -v -tpng ${{ steps.getfile.outputs.files }}
- name: Push Local Changes
if: success()
uses: stefanzweifel/[email protected]
with:
commit_message: "Generate SVG and PNG images for PlantUML diagrams"
branch: ${{ github.head_ref }}