This repository has been archived by the owner on Oct 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 68
chore: add lint checking for our markdown files in CI #205
Merged
+79
−0
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: Links Checker | ||
|
||
on: | ||
## Allow triggering this workflow manually via GitHub CLI/web | ||
workflow_dispatch: | ||
|
||
## Run this workflow automatically every week | ||
schedule: | ||
- cron: '0 0 * * 1' | ||
|
||
jobs: | ||
link_checker: | ||
name: Check links and create automated issue if needed | ||
runs-on: ubuntu-latest | ||
env: | ||
LYCHEE_OUT: ./lychee/links-report | ||
steps: | ||
## Check out code using Git | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Check all links at *.md and doc files | ||
id: lychee | ||
uses: lycheeverse/[email protected] | ||
with: | ||
output: ${{ env.LYCHEE_OUT }} | ||
format: markdown | ||
## Do not fail this step on broken links | ||
fail: false | ||
## Allow pages replying with 200 (Ok)in at most 20 seconds | ||
## This checks all md files in the repo | ||
args: >- | ||
--verbose | ||
--accept 200 | ||
--timeout 20 | ||
--max-concurrency 10 | ||
--no-progress | ||
'./**/*.md' | ||
env: | ||
## Avoid rate limiting when checking github.com links | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Find the last report issue open | ||
uses: micalevisk/[email protected] | ||
id: last_issue | ||
with: | ||
state: open | ||
labels: | | ||
report | ||
automated issue | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Create issue from report file | ||
if: ${{ steps.last_issue.outputs.has_found == 'false' }} | ||
uses: peter-evans/create-issue-from-file@v4 | ||
with: | ||
title: Link checker report | ||
content-filepath: ${{ env.LYCHEE_OUT }} | ||
issue-number: ${{ steps.last_issue.outputs.issue_number }} | ||
labels: | | ||
report | ||
automated issue | ||
|
||
- name: Update last report open issue created | ||
if: ${{ steps.last_issue.outputs.has_found == 'true' }} | ||
uses: peter-evans/create-issue-from-file@v4 | ||
with: | ||
title: Link checker report | ||
content-filepath: ${{ env.LYCHEE_OUT }} | ||
issue-number: ${{ steps.last_issue.outputs.issue_number }} | ||
labels: | | ||
report | ||
automated issue | ||
|
||
- name: Close last report open issue | ||
if: ${{ steps.lychee.outputs.exit_code == 0 }} | ||
uses: peter-evans/close-issue@v2 | ||
with: | ||
issue-number: ${{ steps.last_issue.outputs.issue_number }} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to add the
documentation
label as wellThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can do it independently (manually) as the issue is never deleted or re-created, this is just the tags the flow of the scanner, and I'd rather it selected on a pretty narrow set of tags.