This repository has been archived by the owner on Dec 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 50
97 lines (94 loc) · 2.87 KB
/
pr-appinspect.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
91
92
93
94
95
96
97
name: PR App Inspect
on:
pull_request_target:
branches:
- develop
jobs:
appinspect-addon:
name: AppInspect (Add-on)
runs-on: ubuntu-20.04
# Remove write permissions
permissions:
contents: read
steps:
# Checkout unsafe code
- name: Checkout PR
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
path: pr
persist-credentials: false
# Checkout safe code
- name: Checkout build scripts
uses: actions/checkout@v3
with:
path: tools
# Replace build script in unsafe code with scripts from safe code
- name: Setup build scripts
run: |
rm -rf pr/scripts
mv tools/scripts pr
- name: Build Add-on
id: build-addon
working-directory: pr
run: scripts/build.sh -a addon
- name: Save Add-on Build Artifact
uses: actions/upload-artifact@v1
if: '! cancelled()'
with:
name: Splunk_TA_paloalto-${{ github.run_id }}
path: pr/${{ steps.build-addon.outputs.path }}
- name: AppInspect
working-directory: pr
run: scripts/appinspect.sh -a addon -r
env:
SPLUNK_USER: ${{ secrets.SPLUNK_USER }}
SPLUNK_PASS: ${{ secrets.SPLUNK_PASS }}
- name: Save report
uses: actions/upload-artifact@v1
if: '! cancelled()'
with:
name: Report-Splunk_TA_paloalto-${{ github.run_id }}.html
path: pr/_build/Splunk_TA_paloalto-${{ github.run_id }}.html
appinspect-app:
name: AppInspect (App)
runs-on: ubuntu-20.04
permissions:
contents: read
steps:
- name: Checkout PR
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
path: pr
persist-credentials: false
- name: Checkout build scripts
uses: actions/checkout@v3
with:
path: tools
- name: Setup build scripts
run: |
rm -rf pr/scripts
mv tools/scripts pr
- name: Build App
id: build-app
working-directory: pr
run: scripts/build.sh -a app
- name: Save App Build Artifact
uses: actions/upload-artifact@v1
if: '! cancelled()'
with:
name: SplunkforPaloAltoNetworks-${{ github.run_id }}
path: pr/${{ steps.build-app.outputs.path }}
- name: AppInspect
working-directory: pr
run: scripts/appinspect.sh -a app -r
env:
SPLUNK_USER: ${{ secrets.SPLUNK_USER }}
SPLUNK_PASS: ${{ secrets.SPLUNK_PASS }}
- name: Save report
uses: actions/upload-artifact@v1
if: '! cancelled()'
with:
name: Report-SplunkforPaloAltoNetworks-${{ github.run_id }}.html
path: pr/_build/SplunkforPaloAltoNetworks-${{ github.run_id }}.html