Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
NiceCao
HowToWorkBetter
Repository navigation
Code
Issues
1
(1)
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
HowToWorkBetter
/
.github
/
workflows
/
links.yml
Copy path
View runs
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
34 lines (31 loc) · 1.66 KB
main
Breadcrumbs
HowToWorkBetter
/
.github
/
workflows
/
links.yml
Copy path
Top
File metadata and controls
Code
Blame
34 lines (31 loc) · 1.66 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
# 失效链接检查:每周一 01:00 UTC 自动跑一次全书外链,结果写在这次运行的 Summary 页里。
# 只报告不报错:检查脚本的执行结果不影响工作流成败,所以这个工作流永远是绿的,要看结果得点进本次运行的 Summary。
# 脚本会把握不准的链接分成三类,只有第一类需要动手修:
# 1. 确定失效——服务器明确回 404 / 410,或 DOI 查无此号,链接真的没了,要换成新地址。
# 2. 连不上——连接超时或被拒。多半是政府网站挡了境外机房的 IP(GitHub 的服务器在境外),
# 用你自己的浏览器能打开就不用管;连着几周都连不上才值得看一眼。
# 3. 站点的加密方式较老——TLS 握手谈不拢,是那种老政府站的加密套件太旧。
# 浏览器为了兼容还能打开,脚本连不上,不用修。
# 为什么单独成一个工作流:外链成百上千,通不通跟正文改没改没关系,
# 挂进发布流程里每次推送都跑,既慢又吵。
name: 失效链接检查
on:
schedule:
# 每周一 01:00 UTC(北京时间 09:00)
- cron: '0 1 * * 1'
workflow_dispatch:
permissions:
contents: read
jobs:
links:
name: 失效链接检查
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: 抽查全书外链(只报告,不因失败中断)
# 脚本退出码本身恒为 0;末尾的 || true 只是再加一道保险,确保这一步不会把 job 弄红。
run: python3 tools/check_book.py --urls || true
You can’t perform that action at this time.