Skip to content

Commit

Permalink
chore: Cleanup + Docs (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kunal Nagar authored Aug 15, 2021
1 parent 079771d commit f1831b9
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 45 deletions.
33 changes: 2 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![image](https://user-images.githubusercontent.com/2741371/129387647-f5fdead5-a002-4e3d-9d55-cb7ebe988ff1.png)
![marketing](https://user-images.githubusercontent.com/2741371/129468484-bc0cb5f5-1db5-4ea0-96c6-7f1d2d0aa347.png)

## @kunalnagarco/action-cve

Expand All @@ -7,36 +7,7 @@ A [GitHub action](https:/features/actions) that sends Dependabot Vul
- Slack
- PagerDuty

### Usage

```yaml
name: 'Check for Vulnerabilities'

on:
schedule:
- cron: '0 */6 * * *' # every 6 hours

jobs:
main:
runs-on: ubuntu-latest
steps:
# X.X.X - Latest version available at:
# https:/kunalnagarco/action-cve/releases
- uses: kunalnagarco/[email protected]
with:
# Create a Personal Access Token here:
# https:/settings/tokens
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
# Create a Slack Incoming Webhook URL:
# https://slack.com/apps/A0F7XDUAZ-incoming-webhooks
slack_webhook: ${{ secrets.SLACK_WEBHOOK }}
# Create a Service Integration:
# https://support.pagerduty.com/docs/services-and-integrations#section-events-api-v2
pager_duty_integration_key: ${{ secrets.PAGER_DUTY_INTEGRATION_KEY }}
# Number of vulnerability alerts
# Default: 20
count: 10
```
**For more info and getting started, check out the [Wiki](https:/kunalnagarco/action-cve/wiki/Getting-Started).**

## Attributions

Expand Down
30 changes: 23 additions & 7 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

Binary file removed icons/alert-pager-duty.png
Binary file not shown.
Binary file removed icons/alert-slack.png
Binary file not shown.
6 changes: 6 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export const ACTION_ICON =
'https:/kunalnagarco/action-cve/raw/main/icons/ladybug.png'

export const ACTION_SHORT_SUMMARY = 'GitHub Action - @kunalnagarco/action-cve'

export const ACTION_URL = 'https:/kunalnagarco/action-cve'
7 changes: 4 additions & 3 deletions src/destinations/pager-duty.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { ACTION_ICON, ACTION_SHORT_SUMMARY, ACTION_URL } from '../constants'
import { Alert } from '../entities'
import { event } from '@pagerduty/pdjs'

Expand All @@ -17,9 +18,9 @@ export const sendAlertsToPagerDuty = async (
},
images: [
{
src: 'https:/kunalnagarco/action-cve/raw/main/icons/ladybug.png',
alt: 'GitHub Action Icon',
href: 'https:/kunalnagarco/action-cve',
src: ACTION_ICON,
alt: ACTION_SHORT_SUMMARY,
href: ACTION_URL,
},
],
},
Expand Down
6 changes: 3 additions & 3 deletions src/destinations/slack.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { ACTION_ICON, ACTION_SHORT_SUMMARY } from '../constants'
import { Alert } from '../entities'
import { IncomingWebhook } from '@slack/webhook'
import { KnownBlock } from '@slack/types'
Expand Down Expand Up @@ -74,8 +75,7 @@ export const sendAlertsToSlack = async (
createDividerBlock(),
...alertBlocks,
],
icon_url:
'https:/kunalnagarco/action-cve/raw/main/icons/ladybug.png',
username: 'GitHub Action - @kunalnagarco/action-cve',
icon_url: ACTION_ICON,
username: ACTION_SHORT_SUMMARY,
})
}

0 comments on commit f1831b9

Please sign in to comment.