From e0dccfdc6175a62d82bdcd92bf941803ed40e95f Mon Sep 17 00:00:00 2001 From: Ads Dawson <104169244+GangGreenTemperTatum@users.noreply.github.com> Date: Fri, 27 Dec 2024 08:48:53 -0500 Subject: [PATCH] chore: mod to handle issues and pr separate --- .github/workflows/owasp-workflow-triage.yml | 22 +++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/owasp-workflow-triage.yml b/.github/workflows/owasp-workflow-triage.yml index da83b85..447fae0 100644 --- a/.github/workflows/owasp-workflow-triage.yml +++ b/.github/workflows/owasp-workflow-triage.yml @@ -47,12 +47,22 @@ jobs: - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #v7.0.1 with: script: | - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: '👋 Thanks for reporting! Please ensure labels are applied appropriately to the issue so that the workflow automation can triage this to the correct member of the core team' - }) + const eventName = context.eventName; + if (eventName === 'issues') { + await github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '👋 Thanks for reporting! Please ensure labels are applied appropriately so that the workflow automation can triage this to the assigned member of the OWASP core team' + }); + } else if (eventName === 'pull_request' && context.payload.action === 'opened') { + await github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '👋 Thanks for your pull request! Please ensure appropriate labels are applied for review routing.' + }); + } triage: runs-on: ubuntu-latest