Skip to content

Commit

Permalink
Add CVE Label
Browse files Browse the repository at this point in the history
Signed-off-by: Prudhvi Godithi <[email protected]>
  • Loading branch information
prudhvigodithi committed Oct 11, 2023
1 parent c469fb1 commit 39ce3c4
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/add-cve-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Add CVE Label
on:
issues:
types:
- labeled

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
add-comment:
if: github.event.label.name == "Mend: dependency security vulnerability"
runs-on: ubuntu-latest
steps:
- name: Get Issue Title
id: get_title
run: |
issue_title="${{ github.event.issue.title }}"
severity="$(echo $issue_title | sed -n 's/.*(\(.*\)).*/\1/p')"
echo "severity=$severity" >> $GITHUB_ENV
- name: Add CVE Label
uses: actions/github-script@v6
with:
script: |
github.rest.issues.addLabels({
issue_number: ${{ github.event.issue.number }},
owner: context.repo.owner,
repo: context.repo.repo,
labels: ${{ env.severity }}
})

0 comments on commit 39ce3c4

Please sign in to comment.