-
Notifications
You must be signed in to change notification settings - Fork 438
(experimental) broken link checker (lychee) #2792
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
.github/workflows/link-checker.yml
Outdated
runs-on: ubuntu-latest | ||
steps: | ||
- name: "☁️ Checkout Repository" | ||
# Pinned to a full commit SHA to satisfy security best practices | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | ||
|
||
- name: "🔎 Run Link Checker" | ||
# Pinned to a full commit SHA to satisfy the sha-ref validation error | ||
uses: lycheeverse/lychee-action@2b591b68953f656281b36952a78484920668b598 # v2 | ||
with: | ||
# Points to your source files and uses your lycheerc config | ||
args: "--config ./lycheerc ./src/content/**/*.md*" | ||
# Ensures the step passes so the check doesn't show as "failed" | ||
fail: false | ||
env: | ||
# Required to check GitHub links without being rate-limited | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 4 days ago
To fix the issue, we will add a permissions
block at the root of the workflow file. Since the workflow only needs to read repository contents and use the GITHUB_TOKEN
for checking links, we will set contents: read
as the minimal required permission. This ensures the workflow adheres to the principle of least privilege.
-
Copy modified lines R7-R9
@@ -6,2 +6,5 @@ | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: |
No description provided.