-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (36 loc) · 1.44 KB
/
netpols-to-graph.yaml
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
name: show-network-connectivity-graph
on:
pull_request:
jobs:
report-connectivity:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Produce connectivity report
id: conn-report
uses: np-guard/netpol-reports-gh-action@v2
with:
output-format: dot
- uses: actions/download-artifact@v2
with:
name: ${{ steps.conn-report.outputs.conn-results-artifact }}
- name: create png file, push to repo, add pr comment
run: |
export graph_path=release/connectivity-graph_${GITHUB_HEAD_REF##*/}.png
git config user.name ${{ github.actor }}
git config user.email '${{ github.actor }}@users.noreply.github.com'
git checkout for_graphs
sudo apt install graphviz
dot -Tpng ${{ steps.conn-report.outputs.conn-results-file }} -o $graph_path
git add $graph_path
git diff-index --quiet HEAD || ( git commit -m"adding connectivity graph" && git push )
gh pr comment ${{ github.event.number }} -b""
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: connectivity-graph
path: release/connectivity-graph_${GITHUB_REF##*/}.png