forked from cncf/tag-security
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: fix ci linter scripts (cncf#1223)
Signed-off-by: Mariusz Sabath <[email protected]>
- Loading branch information
Showing
4 changed files
with
31 additions
and
9 deletions.
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 |
---|---|---|
@@ -1,10 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
shopt -s globstar | ||
|
||
FAILURE=0 | ||
|
||
git config --global --add safe.directory /usr/src/app | ||
npm install -g markdown-link-check | ||
git fetch origin main:main | ||
# To run this on the entire repo, replace the following command with `$(find ./ -type f | grep .md)` | ||
for file_name in $(git diff --name-only $HEAD main); do | ||
if [[ $file_name == *".md" ]]; then | ||
npx markdown-link-check --config ./ci/link-config.json --progress --verbose "$file_name" | ||
fi | ||
for file_name in $(git diff --name-only $HEAD main -- ./**/*.md); do | ||
npx markdown-link-check --config ./ci/link-config.json --progress --verbose "$file_name" || FAILURE=1 | ||
done | ||
|
||
exit $FAILURE |
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 |
---|---|---|
@@ -1,10 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
shopt -s globstar | ||
|
||
FAILURE=0 | ||
|
||
git config --global --add safe.directory /usr/src/app | ||
npm install -g markdownlint-cli | ||
git fetch origin main:main | ||
# To run this on the entire repo, replace the following command with `$(find ./ -type f | grep .md)` | ||
for file_name in $(git diff --name-only $HEAD main); do | ||
if [[ $file_name == *".md" ]]; then | ||
markdownlint -c ./ci/lint-config.json "$file_name" | ||
fi | ||
for file_name in $(git diff --name-only $HEAD main -- ./**/*.md); do | ||
markdownlint -c ./ci/lint-config.json "$file_name" || FAILURE=1 | ||
done | ||
|
||
exit $FAILURE |
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
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