forked from bpg/terraform-provider-proxmox
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (47 loc) · 1.79 KB
/
Copy pathlink-check.yml
File metadata and controls
54 lines (47 loc) · 1.79 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
name: "Link Check"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * 0"
permissions:
contents: read
jobs:
link-check:
runs-on: ubuntu-24.04
steps:
- name: Generate Short Lived OAuth App Token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
id: app-token
with:
app-id: "${{ secrets.BOT_APP_ID }}"
private-key: "${{ secrets.BOT_APP_PRIVATE_KEY }}"
owner: "${{ github.repository_owner }}"
repositories: "${{ github.event.repository.name }}"
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Link Checker
uses: lycheeverse/lychee-action@e7477775783ea5526144ba13e8db5eec57747ce8 # v2.9.0
id: lychee
env:
GITHUB_TOKEN: "${{ steps.app-token.outputs.token }}"
with:
args: --max-concurrency 10 --config lychee.toml './**/*.md' './**/*.html'
- name: Find Link Checker Issue
id: link-checker-issue
if: steps.lychee.outputs.exit_code != 0
env:
GH_TOKEN: "${{ steps.app-token.outputs.token }}"
run: |
number=$(gh issue list --state open --label broken-links \
--limit 1 --json number --jq '.[0].number // ""')
echo "issue-number=$number" >> "$GITHUB_OUTPUT"
- name: Update Issue
uses: peter-evans/create-issue-from-file@fca9117c27cdc29c6c4db3b86c48e4115a786710 # v6.0.0
if: steps.lychee.outputs.exit_code != 0
with:
title: Broken links detected 🔗
issue-number: "${{ steps.link-checker-issue.outputs.issue-number }}"
content-filepath: ./lychee/out.md
token: "${{ steps.app-token.outputs.token }}"
labels: |
broken-links