Skip to content

Commit

Permalink
Updating comment logic
Browse files Browse the repository at this point in the history
  • Loading branch information
himsharma01 committed Sep 28, 2024
1 parent ff0dd76 commit 30f47c5
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions .github/workflows/V2App_review.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: v2 App Unit Test
name: v2 App Review

on: [pull_request]

Expand Down Expand Up @@ -27,19 +27,13 @@ jobs:
- name: "Generate SCR File"
run: |
sumoappsuite generate-scr-file-v2-app && cat scr_app_list.yaml | yq ".apps[0].relativeFolderPath" >> appPath
# - name: "Run Sumo Logic App Tests"
# run: |
# sumoappsuite run-all-app-tests-v2 -f scr_app_list.yaml -e test_tfApp_installable,test_is_deployable,test_sumo_query,test_threatintel_query,test_update_v2_app
- 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: List objects in S3 bucket #Testing aws cli
# run: aws s3 ls

- name: "Run Sumo Logic App Review tool" #sumoappsuite review-v2-app -f "{SUMO_APPS_V2_REPO_PATH}{appPath}"
run: |
Expand All @@ -55,15 +49,19 @@ jobs:
- 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
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Excel Sheet artifact URL: ' + '${{ steps.get_artifact_url.outputs.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"
# - name: Comment on PR with Artifact URL
# uses: actions/github-script@v7
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# script: |
# github.issues.createComment({
# issue_number: context.issue.number,
# owner: context.repo.owner,
# repo: context.repo.repo,
# body: 'Excel Sheet artifact URL: ' + '${{ steps.get_artifact_url.outputs.artifact_url }}'
# })

0 comments on commit 30f47c5

Please sign in to comment.