External Mail Provider Monitor #639
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 }} |