forked from labring/sealos
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (52 loc) · 1.97 KB
/
check-link-error.yml
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
name: Check-LinkError
on:
- push
- pull_request_target
- workflow_dispatch
jobs:
linkChecker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Install lychee
run: |
LYCHEEVERSION="0.13.0"
curl -sLO "https://github.com/lycheeverse/lychee/releases/download/v${LYCHEEVERSION}/lychee-v${LYCHEEVERSION}-x86_64-unknown-linux-gnu.tar.gz"
tar -xvzf "lychee-v${LYCHEEVERSION}-x86_64-unknown-linux-gnu.tar.gz"
rm "lychee-v${LYCHEEVERSION}-x86_64-unknown-linux-gnu.tar.gz"
install -t "$HOME/.local/bin" -D lychee
rm lychee
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Link Checker
run: |
set +e
lychee --verbose --format 'markdown' './**/*.md'
exit_code=$?
set -e
echo "lychee_exit_code=$exit_code" >> $GITHUB_ENV
- name: Output the result
id: output_result
run: |
echo "# 🤖 Generated by lychee action" > report.md
GITHUB_WORKFLOW_URL="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}?check_suite_focus=true"
cat .dummy.report.md >> report.md
echo "## Full action output" >> report.md
echo "[Full Github Actions output](${GITHUB_WORKFLOW_URL})" >> report.md
cat report.md
- name: Gh Rebot for Sealos
uses: labring/gh-rebot@v0.0.6
if: ${{ (github.event_name == 'pull_request_target') }}
with:
version: v0.0.6
env:
GH_TOKEN: "${{ secrets.GH_PAT }}"
SEALOS_TYPE: "pr_comment"
SEALOS_FILENAME: "report.md"
SEALOS_REPLACE_TAG: "DEFAULT_REPLACE_LYCHEE"
- name: Exit result
run: |
echo "Output exit code is ${{ env.lychee_exit_code }}"
exit ${{ env.lychee_exit_code }}