-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
59 lines (51 loc) · 1.82 KB
/
dns-check.yml
File metadata and controls
59 lines (51 loc) · 1.82 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
51
52
53
54
55
56
57
58
59
name: DNS Check and Cleanup
on:
schedule:
# Run every Monday at 2 AM UTC
- cron: '0 2 * * 1'
workflow_dispatch: # Allow manual triggering
jobs:
check-dns:
if: github.repository_owner == 'PreMiD'
name: Check Activity URLs via DNS
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/create-github-app-token@v2
id: generate-token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: package.json
cache: npm
- name: Install dependencies
run: npm ci
- name: Run DNS check
id: dns-check
run: npx pmd check-dns --all --fix
- name: Create Pull Request
if: steps.dns-check.outputs.has_changes == 'true'
uses: peter-evans/create-pull-request@v8
with:
token: ${{ steps.generate-token.outputs.token }}
branch: dns-check-${{ github.run_id }}
delete-branch: true
commit-message: 'chore: remove activities with failed DNS checks'
title: 'chore: remove activities with failed DNS checks'
body-path: ${{ steps.dns-check.outputs.summary_path }}
sign-commits: true
labels: |
repo maintenance
${{ steps.dns-check.outputs.has_deletions == 'true' && 'activity deletion' || '' }}
${{ steps.dns-check.outputs.has_updates == 'true' && 'activity update' || '' }}
${{ steps.dns-check.outputs.has_multiple_activities == 'true' && 'multiple activities' || '' }}