Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.

Commit f1831b9

Browse files
author
Kunal Nagar
authored
chore: Cleanup + Docs (kunalnagarco#22)
1 parent 079771d commit f1831b9

File tree

8 files changed

+39
-45
lines changed

8 files changed

+39
-45
lines changed

README.md

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![image](https://user-images.githubusercontent.com/2741371/129387647-f5fdead5-a002-4e3d-9d55-cb7ebe988ff1.png)
1+
![marketing](https://user-images.githubusercontent.com/2741371/129468484-bc0cb5f5-1db5-4ea0-96c6-7f1d2d0aa347.png)
22

33
## @kunalnagarco/action-cve
44

@@ -7,36 +7,7 @@ A [GitHub action](https://github.com/features/actions) that sends Dependabot Vul
77
- Slack
88
- PagerDuty
99

10-
### Usage
11-
12-
```yaml
13-
name: 'Check for Vulnerabilities'
14-
15-
on:
16-
schedule:
17-
- cron: '0 */6 * * *' # every 6 hours
18-
19-
jobs:
20-
main:
21-
runs-on: ubuntu-latest
22-
steps:
23-
# X.X.X - Latest version available at:
24-
# https://github.com/kunalnagarco/action-cve/releases
25-
- uses: kunalnagarco/action-cve@vX.X.X
26-
with:
27-
# Create a Personal Access Token here:
28-
# https://github.com/settings/tokens
29-
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
30-
# Create a Slack Incoming Webhook URL:
31-
# https://slack.com/apps/A0F7XDUAZ-incoming-webhooks
32-
slack_webhook: ${{ secrets.SLACK_WEBHOOK }}
33-
# Create a Service Integration:
34-
# https://support.pagerduty.com/docs/services-and-integrations#section-events-api-v2
35-
pager_duty_integration_key: ${{ secrets.PAGER_DUTY_INTEGRATION_KEY }}
36-
# Number of vulnerability alerts
37-
# Default: 20
38-
count: 10
39-
```
10+
**For more info and getting started, check out the [Wiki](https://github.com/kunalnagarco/action-cve/wiki/Getting-Started).**
4011

4112
## Attributions
4213

dist/index.js

Lines changed: 23 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

icons/alert-pager-duty.png

-1.23 MB
Binary file not shown.

icons/alert-slack.png

-185 KB
Binary file not shown.

src/constants.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export const ACTION_ICON =
2+
'https://github.com/kunalnagarco/action-cve/raw/main/icons/ladybug.png'
3+
4+
export const ACTION_SHORT_SUMMARY = 'GitHub Action - @kunalnagarco/action-cve'
5+
6+
export const ACTION_URL = 'https://github.com/kunalnagarco/action-cve'

src/destinations/pager-duty.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { ACTION_ICON, ACTION_SHORT_SUMMARY, ACTION_URL } from '../constants'
12
import { Alert } from '../entities'
23
import { event } from '@pagerduty/pdjs'
34

@@ -17,9 +18,9 @@ export const sendAlertsToPagerDuty = async (
1718
},
1819
images: [
1920
{
20-
src: 'https://github.com/kunalnagarco/action-cve/raw/main/icons/ladybug.png',
21-
alt: 'GitHub Action Icon',
22-
href: 'https://github.com/kunalnagarco/action-cve',
21+
src: ACTION_ICON,
22+
alt: ACTION_SHORT_SUMMARY,
23+
href: ACTION_URL,
2324
},
2425
],
2526
},

src/destinations/slack.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { ACTION_ICON, ACTION_SHORT_SUMMARY } from '../constants'
12
import { Alert } from '../entities'
23
import { IncomingWebhook } from '@slack/webhook'
34
import { KnownBlock } from '@slack/types'
@@ -74,8 +75,7 @@ export const sendAlertsToSlack = async (
7475
createDividerBlock(),
7576
...alertBlocks,
7677
],
77-
icon_url:
78-
'https://github.com/kunalnagarco/action-cve/raw/main/icons/ladybug.png',
79-
username: 'GitHub Action - @kunalnagarco/action-cve',
78+
icon_url: ACTION_ICON,
79+
username: ACTION_SHORT_SUMMARY,
8080
})
8181
}

0 commit comments

Comments
 (0)