.github/workflows/check-domain.yml

42 lines · 1877 bytes

 1# Checks domain and SSL status, then raises an issue if either is expiring soon
 2name: 🌎 Check Domain Expiry
 3on:
 4  workflow_dispatch:
 5  schedule:
 6    - cron: '0 5 * * 6' # Every Saturday morning.
 7jobs:
 8  check-domain:
 9    runs-on: ubuntu-latest
10    name: Check domain
11    strategy:
12      matrix:
13        domain:
14          - https://awesome-privacy.xyz
15    steps:
16      - name: Check domain SSL and registry expire date
17        id: check-domain
18        uses: codex-team/action-check-domain@v1
19        with:
20          url: ${{ matrix.domain }}
21      - name: Raise issue if domain expiring soon
22        if: ${{ steps.check-domain.outputs.paid-till-days-left && steps.check-domain.outputs.paid-till-days-left < 30 }}
23        uses: rishabhgupta/git-action-issue@v2
24        with:
25          token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
26          assignees: Lissy93
27          title: '[WEBSITE] Domain Expiring Soon'
28          body: >
29            **Priority Notice**
30            Domain, ${{ matrix.domain }} will expire in ${{ steps.check-domain.outputs.paid-till-days-left }} days.
31            @Lissy93 - Please take action immediately to prevent any downtime
32      - name: Raise issue if SSL Cert expiring soon
33        if: ${{ steps.check-domain.outputs.ssl-expire-days-left && steps.check-domain.outputs.ssl-expire-days-left < 14 }}
34        uses: rishabhgupta/git-action-issue@v2
35        with:
36          token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
37          assignees: Lissy93
38          title: '[WEBSITE] SSL Cert Expiring Soon'
39          body: >
40            **Priority Notice**
41            The SSL Certificate for ${{ matrix.domain }} will expire in ${{ steps.check-domain.outputs.ssl-expire-days-left }} days, on ${{ steps.check-domain.outputs.ssl-expire-date }}.
42            @Lissy93 - Please take action immediately to prevent any downtime