Skip to content

AddOssIndexExclusion #7

AddOssIndexExclusion

AddOssIndexExclusion #7

name: AddOssIndexExclusion
on:
workflow_dispatch:
inputs:
exclusion:
description: 'Vulnerability to exclude'
required: true
type: string
permissions: read-all
jobs:
build:
name: Add OSS Index Exclusion action
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
with:
fetch-depth: 0
token: ${{ secrets.PUBLISH_KEY }}
- name: "Add exclusion"
run: |
echo "${{ github.event.inputs.exclusion }}" >> config/ossindex/exclusions.txt
- name: "git branch"
run: |
git config --global user.name 'Esta Nagy'
git config --global user.email 'nagyesta@gmail.com'
git checkout -b feature/exclude-vulnerability-run-${{ github.run_number }}
git add config/ossindex/exclusions.txt
git commit -asm "Excluding vulnerability ${{ github.event.inputs.exclusion }} {patch}"
git push -f --set-upstream origin feature/exclude-vulnerability-run-${{ github.run_number }}
- uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
with:
github-token: ${{ secrets.PUBLISH_KEY }}
script: |
github.rest.pulls.create({
owner: "${{ github.repository_owner }}",
repo: "lowkey-vault",
head: "feature/exclude-vulnerability-run-${{ github.run_number }}",
base: "main",
title: "Excluding vulnerability ${{ github.event.inputs.exclusion }} {patch}"
});