-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (63 loc) · 1.99 KB
/
health-check.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
64
65
66
67
68
69
70
71
72
73
74
75
name: Check code health
on:
push:
branches: [master, main]
schedule:
- cron: "0 9 * 1-12 6"
jobs:
Scan:
name: Secrets Scan
runs-on: ubuntu-latest
steps:
- name: Check out the repository code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Scan the repository to find hardcoded secrets
uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
Shellcheck:
runs-on: ubuntu-latest
steps:
- name: Check out the repository code
uses: actions/checkout@v4
- name: Run Shellcheck
run: make check-scripts
Test:
name: Test install and uninstall on macOS
runs-on: macos-14
timeout-minutes: 30
steps:
- name: Set up Homebrew PATH environment
run: echo "/usr/local/bin:/usr/bin:/bin" >> "${GITHUB_PATH}"
- name: Run install script
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/YasminTeles/dotfiles/main/install.sh)"
env:
CI: true
- name: Show the Home directory
run: |
cd ~
ls -la
- name: Run uninstall script
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/YasminTeles/dotfiles/main/uninstall.sh)"
env:
CI: true
- name: Show the Home directory
run: |
cd ~
ls -la
Message:
name: Error message
needs: [Scan, Shellcheck, Test]
runs-on: ubuntu-latest
if: ${{ failure() }}
steps:
- name: Post to Slack
id: slack
uses: slackapi/[email protected]
with:
channel-id: ${{ secrets.SLACK_CHANNEL }}
slack-message: ":eyes: *${{ github.repository }}* GitHub Actions: ${{ github.workflow }} #${{ github.run_number }} failed.\n<${{ github.event.repository.url }}/actions/runs/${{ github.run_id }}|${{ github.event.head_commit.message }}>"
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}