-
Notifications
You must be signed in to change notification settings - Fork 28
63 lines (53 loc) · 1.89 KB
/
check_secrets.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Checking secrets
on: [push, workflow_dispatch]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
git-secrets:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Running git secrets
run: |
echo Installing git-secrets
(cd ../../; git clone https://github.com/awslabs/git-secrets.git; cd git-secrets; sudo make install)
pwd
git secrets --register-aws --global
git config -l
echo Runing git secrets
secretsOutput="$(git secrets --scan-history 2>&1)"
echo "$secretsOutput"
echo ${{ github.event.base_ref }}
echo ${{ github.event.before }}
echo ---------------
git branch
ls
echo ---------------
(cd ../; ls;)
git secrets --scan-history
echo Done running secrets
if echo "$secretsOutput" | grep -c ERROR; then
exit 1
else
exit 0
fi
slack-workflow-status:
if: failure()
name: Post Git Secrets Status To Slack
needs:
- git-secrets
runs-on: ubuntu-latest
steps:
- name: Slack Workflow Notification
uses: Gamesight/slack-workflow-status@master
with:
# Required Input
repo_token: ${{secrets.GITHUB_TOKEN}}
slack_webhook_url: ${{secrets.SLACK_WEBHOOK_URL}}
# Optional Input
channel: '#webhook-calls'
name: 'CueLake Secrets Workflow Failed'
icon_url: 'https://avatars.githubusercontent.com/u/54435418?s=200&v=4'