Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
docs/.github/workflows/check-broken-links-github-github.yml at main · 0-vortex/docs · GitHub
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
See 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 }}
0-vortex
docs
Repository navigation
Code
Pull requests
1
(1)
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
docs
/
.github
/
workflows
/
check-broken-links-github-github.yml
Copy path
View runs
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
75 lines (65 loc) · 3.09 KB
main
Breadcrumbs
docs
/
.github
/
workflows
/
check-broken-links-github-github.yml
Copy path
Top
File metadata and controls
Code
Blame
75 lines (65 loc) · 3.09 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
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name
:
Check Broken Docs Links in github/github
#
**What it does**: This checks for any broken docs.github.com links in github/github
#
**Why we have it**: Make sure all docs in github/github are up to date
#
**Who does it impact**: Docs engineering, people on GitHub
on
:
workflow_dispatch
:
schedule
:
-
cron
:
'
20 13 * * 1
'
#
run every Monday at 1:20PM UTC
#
**IMPORTANT:** Do not change the FREEZE environment variable set here!
#
This workflow runs on a recurring basis. To temporarily disable it (e.g.,
#
during a docs deployment freeze), add an Actions Secret to the repo settings
#
called `FREEZE` with a value of `true`. To re-enable workflow, simply
#
delete that Secret from the repo settings. The environment variable here
#
will duplicate that Secret's value for later evaluation.
env
:
FREEZE
:
${{ secrets.FREEZE }}
jobs
:
check_github_github_links
:
if
:
github.repository == 'github/docs-internal'
runs-on
:
ubuntu-latest
env
:
#
need to use a token from a user with access to github/github for this step
GITHUB_TOKEN
:
${{ secrets.DOCS_BOT_FR }}
FIRST_RESPONDER_PROJECT
:
Docs content first responder
REPORT_AUTHOR
:
docubot
REPORT_LABEL
:
github github broken link report
REPORT_REPOSITORY
:
github/docs-content
steps
:
-
if
:
${{ env.FREEZE == 'true' }}
run
:
|
echo 'The repo is currently frozen! Exiting this workflow.'
exit 1 # prevents further steps from running
-
name
:
Checkout
uses
:
actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
-
name
:
Setup Node
uses
:
actions/setup-node@270253e841af726300e85d718a5f606959b2903c
with
:
node-version
:
16.13.x
cache
:
npm
-
name
:
Install Node.js dependencies
run
:
npm ci
-
name
:
Run broken github/github link check
run
:
|
script/check-github-github-links.js > broken_github_github_links.md
#
check-github-github-links.js returns 0 if no links are broken, and 1 if any links
#
are broken. When an Actions step's exit code is 1, the action run's job status
#
is failure and the run ends. The following steps create an issue for the
#
broken link report only if any links are broken, so `if: ${{ failure() }}`
#
ensures the steps run despite the previous step's failure of the job.
#
#
https://docs.github.com/actions/reference/context-and-expression-syntax-for-github-actions#job-status-check-functions
-
if
:
${{ failure() && env.FREEZE != 'true' }}
name
:
Get title for issue
id
:
check
run
:
echo "::set-output name=title::$(head -1 broken_github_github_links.md)"
-
if
:
${{ failure() && env.FREEZE != 'true'}}
name
:
Create issue from file
id
:
github-github-broken-link-report
uses
:
peter-evans/create-issue-from-file@b4f9ee0a9d4abbfc6986601d9b1a4f8f8e74c77e
with
:
token
:
${{ env.GITHUB_TOKEN }}
title
:
${{ steps.check.outputs.title }}
content-filepath
:
./broken_github_github_links.md
repository
:
${{ env.REPORT_REPOSITORY }}
labels
:
${{ env.REPORT_LABEL }}
You can’t perform that action at this time.