diff --git a/.github/workflows/SnykNotificationTeam.yml b/.github/workflows/SnykNotificationTeam.yml new file mode 100644 index 0000000000..2c30d10435 --- /dev/null +++ b/.github/workflows/SnykNotificationTeam.yml @@ -0,0 +1,46 @@ +name: "Snyk Noti Test" + +on: + pull_request: + push: + branches: + # Update to master branch + - master + +jobs: + prCheck: + # Confirm PR Check status + runs-on: ubuntu-latest + outputs: + output1: ${{ steps.step1.outputs.status }} + + steps: + # Checks the status of Snyk PR Checks + - name: 'Wait for status checks' + id: waitforstatuschecks + uses: "WyriHaximus/github-action-wait-for-status@v2" + with: + ignoreActions: ## Note that these names are the human readable names use as status on commits, and show up as status checks on PRs. + checkInterval: 13 + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + + - name: 'Set Failed status' + id: step1 + if: steps.waitforstatuschecks.outputs.status == 'failed' + run: echo "status=failed" >> "$GITHUB_OUTPUT" + + prReviewer: + # Add AppSec Reviewer if PR check failed + needs: prCheck + if: needs.prCheck.outputs.output1 == 'failed' + runs-on: ubuntu-latest + + steps: + - name: Add Reviewers + uses: madrapps/add-reviewers@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + reviewers: john,kramer,seinfeld + re-request-when-approved: true + re-request-when-changes-requested: true \ No newline at end of file