Skip to content
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

Add markdown check action #4907

Merged
merged 23 commits into from
Mar 18, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/markdown-links-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Check Markdown links
jlowe marked this conversation as resolved.
Show resolved Hide resolved

on:
pull_request_target:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pull_request_target -> pull_request to checkout the "refs/pull/:prNumber/merge"
otherwise the
- uses: actions/checkout@master
will check out the BASE ref here (branch-22.04)

FYI we use pull_request_target in signoff-check is only because that the check is based on BASE branch instead of relying on developer's feature branch

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks and good to know that, one question is that do we need a GITHUB_TOKEN when we use pull_request ?
If we don't add a GITHUB_TOKEN, will we hit Error: Parameter token or opts.auth is required?

Copy link
Collaborator

@pxLi pxLi Mar 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GITHUB_TOKEN is the default token of repo and is maintained by github action itself as ENV.

If we don't add a GITHUB_TOKEN, will we hit Error: Parameter token or opts.auth is required?

For actions/checkout, no.
I am not sure where you did get this error, if the some specific action require adding specific arg, then you can try add

      with:
        token: ${{ secrets.GITHUB_TOKEN }}

above was just an example, this really arg naming depends on the action provider, if they require extra tokens (or access), they should have documented somewhere in their repo

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
after changing to pull_request, you can see result in this PR's check status

types: [opened, synchronize, reopened]

jobs:
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
max-depth: -1
use-verbose-mode: 'yes'
jlowe marked this conversation as resolved.
Show resolved Hide resolved
config-file: '.github/workflows/markdown-links-check/markdown-links-check-config.json'
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"ignorePatterns": [
{
"pattern": "https:\/\/mvnrepository"
},
{
"pattern": "http:\/\/RM_hostname"
},
{
"pattern": "\/docs\/img\/perf-cost.png"
},
{
"pattern": "\/docs\/img\/ease-of-use.png"
},
{
"pattern": "\/docs\/get-started\/getting-started.md"
jlowe marked this conversation as resolved.
Show resolved Hide resolved
},
{
"pattern": "\/docs\/img\/spark3cluster.png"
},
{
"pattern": "\/docs\/archives"
},
{
"pattern": "https:\/\/github.com\/NVIDIA\/spark-rapids\/issues\/"
}
],
"timeout": "5s",
"retryCount":10,
"aliveStatusCodes": [302, 200, 429]
}