-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #213 from flotiq/feature/24104-check-excluded-snip…
…pets #24104 script for checking excluded snippets
- Loading branch information
Showing
8 changed files
with
55 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
filelist=$(find ./docs -type f -name "*.md") | ||
pattern='```' | ||
|
||
|
||
for file in $filelist | ||
do | ||
|
||
for line in $(grep -Fn $pattern $file | sed -e's/:.*//' | sed -n 'n;p') | ||
do | ||
if ! [[ $(awk "NR==$line+1" $file) == *"{ data-search-exclude }"* || $(awk "NR==$line+2" $file) == *"{ data-search-exclude }"* ]]; then | ||
echo "Snippet in line $line in file $file is not excluded from search" >> status.txt | ||
fi | ||
done | ||
done | ||
|
||
if [ -s "status.txt" ] || [ -f "status.txt" ] ;then | ||
cat status.txt | ||
exit 7 | ||
else | ||
echo "Every snippet has been excluded from search results" | ||
fi | ||
|
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,15 @@ | ||
name: Snippet check script | ||
# Controls when the action will run. Triggers the workflow on push | ||
# events but only for the master branch | ||
on: | ||
pull_request | ||
|
||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest # The type of runner that the job will run on | ||
steps: # Steps represent a sequence of tasks that will be executed as part of the job | ||
- name: Check out the repository | ||
uses: actions/checkout@v2 | ||
- name: Run the script | ||
run: .github/check-excluded-snippets.sh |
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
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 |
---|---|---|
|
@@ -31,13 +31,15 @@ Flotiq always provides your up-to-date API definition in an OpenAPI 3.0 compatib | |
``` shell | ||
npm install @openapitools/[email protected] -g | ||
``` | ||
{ data-search-exclude } | ||
|
||
|
||
This will instal the OpenAPI generator that will allow you to generate more packages. List of supported generators is mentioned [here](https://openapi-generator.tech/docs/generators) | ||
|
||
``` | ||
openapi-generator generate -g <name> -i <path_to_open_api_schema_json> --skip-validate-spec -o <output_path> | ||
``` | ||
{ data-search-exclude } | ||
|
||
Parameters description: | ||
|
||
|
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
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