-
Notifications
You must be signed in to change notification settings - Fork 182
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
check-links added to repo #1559
Merged
Merged
Changes from 10 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
12dcac8
check-links added
RichardChukwu f08e20e
Merge branch 'main' into main
RichardChukwu 8fa8977
Merge branch 'main' into main
RichardChukwu 9d8ad7c
Review
RichardChukwu 142ab91
Merge branches 'main' and 'main' of https://github.com/RichardChukwu/…
RichardChukwu d91bdb8
Merge branch 'main' into main
RichardChukwu 751d0a2
Merge branches 'main' and 'main' of https://github.com/RichardChukwu/…
RichardChukwu de1ac10
Merge branch 'main' of https://github.com/RichardChukwu/opentelemetry…
RichardChukwu c684b3b
Dotnet changes removed
RichardChukwu 4daf044
Delete dotnet/sample-apps/aws-sdk/wrapper/SampleApps/AwsSdkSample/obj…
RichardChukwu 51ca6ed
Merge branch 'main' into main
RichardChukwu 0cb7103
Undo deleted AwsSdkSample.sln
RichardChukwu 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,46 @@ | ||
name: check-links | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref }} | ||
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; } | ||
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,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" | ||
} | ||
} | ||
] | ||
} |
25 changes: 0 additions & 25 deletions
25
dotnet/sample-apps/aws-sdk/wrapper/SampleApps/AwsSdkSample.sln
This file was deleted.
Oops, something went wrong.
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.
Could you explain this line a bit?
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.
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
needs.changedfiles.outputs.md
variable is used to dynamically target only the markdown files that were modified in the PR.The ||
{ echo "Check that anchor links are lowercase"; exit 1; }
part is a fallback check to ensure that if there are any issues with the anchor links not being lowercase (which is a requirement for valid markdown links), the workflow will fail and print a meaningful message for the contributor to resolve.However, if this check is redundant, I can adjust or remove it.
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.
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?
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.
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
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.
I don't have any specific insight here. Maybe investigate what other OpenTelemetry repos are doing?