generated from upptime/upptime
-
Notifications
You must be signed in to change notification settings - Fork 6
50 lines (50 loc) · 1.53 KB
/
external-mail-monitor.yml
File metadata and controls
50 lines (50 loc) · 1.53 KB
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
name: External Mail Provider Monitor
on:
schedule:
- cron: "*/10 * * * *"
repository_dispatch:
types: [external-mail-monitor]
workflow_dispatch:
permissions:
contents: write
issues: write
jobs:
monitor:
name: Check external mail status
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GH_PAT || github.token }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- name: Install dependencies
run: npm ci --ignore-scripts || npm install
- name: Run external mail monitor
env:
GH_PAT: ${{ secrets.GH_PAT || github.token }}
GITHUB_TOKEN: ${{ secrets.GH_PAT || github.token }}
run: node scripts/external-mail-monitor.js
- name: Configure Git
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Commit state file
run: |
if [ -f .external-mail-status.json ]; then
git add .external-mail-status.json
if git diff --staged --quiet; then
echo "No changes to state file"
else
git commit -m "chore: update external mail status [skip ci]"
git push
fi
fi
env:
GH_PAT: ${{ secrets.GH_PAT || github.token }}