-
Notifications
You must be signed in to change notification settings - Fork 229
check-links added to repo #1559
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
Changes from 1 commit
12dcac8
f08e20e
8fa8977
9d8ad7c
142ab91
d91bdb8
751d0a2
de1ac10
c684b3b
4daf044
51ca6ed
0cb7103
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| name: check-links | ||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.head_ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| changedfiles: | ||
| name: changed files | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| PR_HEAD: ${{ github.event.pull_request.head.sha }} | ||
| outputs: | ||
| md: ${{ steps.changes.outputs.md }} | ||
| steps: | ||
| - name: Checkout Repo | ||
| uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Get changed files | ||
| id: changes | ||
| run: | | ||
| echo "md=$(git diff --name-only --diff-filter=ACMRTUXB $(git merge-base origin/main $PR_HEAD) $PR_HEAD | grep .md$ | xargs)" >> $GITHUB_OUTPUT | ||
|
|
||
| check-links: | ||
| runs-on: ubuntu-latest | ||
| needs: changedfiles | ||
| if: ${{needs.changedfiles.outputs.md}} | ||
| steps: | ||
| - name: Checkout Repo | ||
| uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Install markdown-link-check | ||
| run: npm install | ||
|
|
||
| - name: Run markdown-link-check | ||
| run: | | ||
| npx --no -- markdown-link-check \ | ||
| --verbose \ | ||
| --config .github/workflows/check_links_config.json \ | ||
| ${{needs.changedfiles.outputs.md}} \ | ||
| || { echo "Check that anchor links are lowercase"; exit 1; } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you explain this line a bit?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, This line of code runs the markdown-link-check with verbose logging enabled and specifies the custom configuration file (check_links_config.json). The The || However, if this check is redundant, I can adjust or remove it.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not objecting to the current implementation, but I wonder if maybe a linter would do a better job of that particular edge case. What do you think?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree that a linter might be more appropriate for this edge case, as it would likely cover more general cases of markdown formatting and anchor validation. Not quite sure how to implement exactly for this as I'm new here. I'll appreciate any help @tylerbenson
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't have any specific insight here. Maybe investigate what other OpenTelemetry repos are doing? |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| { | ||
| "ignorePatterns": [ | ||
| { | ||
| "pattern": "http(s)?://\\d+\\.\\d+\\.\\d+\\.\\d+" | ||
| }, | ||
| { | ||
| "pattern": "http(s)?://localhost" | ||
| }, | ||
| { | ||
| "pattern": "http(s)?://example.com" | ||
| }, | ||
| { | ||
| "pattern": "https://docs.aws.amazon.com" | ||
| }, | ||
| { | ||
| "pattern": "https://console.aws.amazon.com" | ||
| } | ||
| ], | ||
| "aliveStatusCodes": [429, 200], | ||
| "httpHeaders": [ | ||
| { | ||
| "urls": ["https://docs.aws.amazon.com", "https://docs.github.com/"], | ||
| "headers": { | ||
| "Accept-Encoding": "zstd, br, gzip, deflate" | ||
| } | ||
| } | ||
| ] | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.