-
Notifications
You must be signed in to change notification settings - Fork 24
58 lines (51 loc) · 2.32 KB
/
V2App_review.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: v2 App Review
on: [pull_request]
jobs:
v2-app-unit-test:
name: "V2 App Review"
runs-on: "ubuntu-latest"
env:
SUMO_APPS_V2_REPO_PATH: ${{ github.workspace }}
TARGET_BRANCH: "origin/${{ github.event.pull_request.base.ref }}"
SOURCE_BRANCH: "origin/${{ github.event.pull_request.head.ref }}"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install dependencies
run: |
python3 -m pip install -U pip wheel setuptools yq
- name: "Install sumoappsuite tool"
run: |
pip3 install $GITHUB_WORKSPACE/scripts/sumologic_appdevutils*.whl
- name: "Generate SCR File"
id: generate_scr_file
run: |
echo "::set-output name=app_path::$(sumoappsuite generate-scr-file-v2-app > /dev/null && cat scr_app_list.yaml | yq ".apps[0].relativeFolderPath")"
- name: Set up AWS CLI
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: "us-west-2"
- name: "Run Sumo Logic App Review tool" #sumoappsuite review-v2-app -f "{SUMO_APPS_V2_REPO_PATH}{appPath}"
run: |
echo "${SUMO_APPS_V2_REPO_PATH}/${{ steps.generate_scr_file.outputs.app_path }}"
- name: Upload Excel Sheet as PR Comment
id: upload_artifact
uses: actions/upload-artifact@v4
with:
name: excel-sheet
path: ${SUMO_APPS_V2_REPO_PATH}/src/${{ steps.generate_scr_file.outputs.app_path }}/appreviewoutput.xlsx
- name: Get Artifact URL
id: get_artifact_url
run: echo "::set-output name=artifact_url::${{ steps.upload_artifact.outputs.artifact-url }}"
- name: Comment on PR with Artifact URL
run: |
PR_NUMBER=$(echo $GITHUB_REF | awk -F'/' '{print $3}')
ARTIFACT_URL="${{ steps.get_artifact_url.outputs.artifact_url }}"
curl -X POST -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -d "{\"body\": \"Excel Sheet artifact URL: $ARTIFACT_URL\"}" "https://api.github.com/repos/${{ github.repository }}/issues/$PR_NUMBER/comments"