Skip to content

Commit

Permalink
github spelling and grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
levgorbunov1 committed Sep 4, 2024
1 parent 5ce6cb4 commit 197bf0e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions slack-github-secret-scanning-integration/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Slack - Github Secrets Scanning ALerts Integration
# Slack - GitHub Secrets Scanning Alerts Integration

A Github Action to get alerts from github secret scanning and send them to Slack.
A GitHub Action to forward alerts from GitHub secret scanning and send them to Slack.

## Usage

```
- uses: ministryofjustice/github-actions/slack-github[email protected]
- uses: ministryofjustice/GitHub-actions/slack-GitHub[email protected]
with:
github-token: ${{ secrets.SECRET_SCANNING_GITHUB_TOKEN }}
GitHub-token: ${{ secrets.SECRET_SCANNING_GitHub_TOKEN }}
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
```

| Parameter | Description | Required | Default |
| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- |
| frequency | Get secret scanning alerts that have occurred in this period prior to this action running | false | 24 hours |
| github-token | [Github token with access to secret scanning](https://docs.github.com/en/rest/secret-scanning/secret-scanning?apiVersion=2022-11-28#list-secret-scanning-alerts-for-a-repository) | true | NA |
| github-token | [GitHub token with access to secret scanning](https://docs.GitHub.com/en/rest/secret-scanning/secret-scanning?apiVersion=2022-11-28#list-secret-scanning-alerts-for-a-repository) | true | NA |
| slack-webhook-url | Incoming Slack webhook url for channel that you want to send alerts to | true | NA |
18 changes: 9 additions & 9 deletions slack-github-secret-scanning-integration/action.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: "Slack - Github Secret Scanning Alerts Integration"
description: "A Github Action to get alerts from github secret scanning and send them to Slack"
name: "Slack - GitHub Secret Scanning Alerts Integration"
description: "A GitHub Action to get alerts from GitHub secret scanning and send them to Slack"
inputs:
github-token:
description: "Github token with access to secret scanning"
GitHub-token:
description: "GitHub token with access to secret scanning"
required: true
slack-webhook-url:
description: "Incoming Slack webhook url for channel that you want to send alerts to"
Expand All @@ -18,7 +18,7 @@ runs:
id: secret-scanning
uses: advanced-security/secret-scanning-notifications@v1
with:
token: ${{ inputs.github-token }}
token: ${{ inputs.github-token}}
frequency: ${{ inputs.frequency }}
scope: 'repository'
new_alerts_filepath: 'new_alerts.json'
Expand All @@ -27,23 +27,23 @@ runs:
- name: Check number of new alerts
shell: bash
id: get-new-alerts
run: echo "new_alerts=$(jq 'length' new_alerts.json)" >> "$GITHUB_OUTPUT"
run: echo "new_alerts=$(jq 'length' new_alerts.json)" >> "$GitHub_OUTPUT"

- name: Convert json to plaintext
shell: bash
if: ${{ steps.get-new-alerts.outputs.new_alerts > 0}}
id: json-to-plaintext
run: |
echo "new-alerts=$(jq -r '.[] | "- \(.secret_type_display_name): \(.html_url)"' new_alerts.json)" >> "$GITHUB_OUTPUT"
echo "new-alerts=$(jq -r '.[] | "- \(.secret_type_display_name): \(.html_url)"' new_alerts.json)" >> "$GitHub_OUTPUT"
- name: Send notification to Slack
id: slack
if: ${{ steps.json-to-plaintext.outcome == 'success' }}
uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 #v1.24.0
uses: slackapi/slack-GitHub-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 #v1.24.0
with:
payload: |
{
"text": "New Github Secret Scanning Alerts Detected:\n\n${{ steps.json-to-plaintext.outputs.new-alerts }}"
"text": "New GitHub Secret Scanning Alerts Detected:\n\n${{ steps.json-to-plaintext.outputs.new-alerts }}"
}
env:
SLACK_WEBHOOK_URL: ${{ inputs.slack-webhook-url }}
Expand Down

0 comments on commit 197bf0e

Please sign in to comment.