From c80e5383e4fb9e2a11c740c5f1e5d778950bf882 Mon Sep 17 00:00:00 2001 From: Ads Dawson <104169244+GangGreenTemperTatum@users.noreply.github.com> Date: Fri, 27 Dec 2024 08:54:04 -0500 Subject: [PATCH] chore: expand workflow to prs (#523) * chore: expand workflow to prs * chore: mod to handle issues and pr separate * chore: slight mod codeowners --- ...e-triage.yml => owasp-workflow-triage.yml} | 34 ++++++++++++++----- CODEOWNERS | 3 +- 2 files changed, 28 insertions(+), 9 deletions(-) rename .github/workflows/{issue-triage.yml => owasp-workflow-triage.yml} (79%) diff --git a/.github/workflows/issue-triage.yml b/.github/workflows/owasp-workflow-triage.yml similarity index 79% rename from .github/workflows/issue-triage.yml rename to .github/workflows/owasp-workflow-triage.yml index 6d4b670..447fae0 100644 --- a/.github/workflows/issue-triage.yml +++ b/.github/workflows/owasp-workflow-triage.yml @@ -1,8 +1,16 @@ -name: Ads - Triage OWASP Top 10 LLM Apps Issues +name: Ads - Triage OWASP Top 10 LLM Apps Issues and PRs on: issues: - types: [opened, labeled, reopened] + types: + - opened + - labeled + - reopened + pull_request: + types: + - opened + - labeled + - reopened env: BOARD_NAME: "OWASP Top 10 for LLM Applications" @@ -39,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 diff --git a/CODEOWNERS b/CODEOWNERS index c1ae725..4d057da 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -4,8 +4,9 @@ # Shared Community Files and Areas: # TBC -## Either Ads or Steve can approve changes to CODEOWNERS: +## Either Ads or Steve can approve changes to CODEOWNERS or github: CODEOWNERS @GangGreenTemperTatum @virtualsteve-star +.github/ @GangGreenTemperTatum @virtualsteve-star ## Data Gathering data_gathering/* @emmanuelgjr @GangGreenTemperTatum