-
-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update code, replace JS script with bash
Changes: - replaced the JavaScript code with bash script - suggested by Sergio here: #1046 (comment)
- Loading branch information
1 parent
a60325f
commit 20ca1f9
Showing
1 changed file
with
11 additions
and
29 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 |
---|---|---|
|
@@ -3,8 +3,8 @@ name: Validate AsyncAPI Examples | |
on: | ||
push: | ||
branches: | ||
- master | ||
- script-ci-spec-validation # added temporarily for testing purpose | ||
# - master | ||
|
||
pull_request_target: | ||
types: [opened, reopened, synchronize, edited, ready_for_review] | ||
|
@@ -48,32 +48,14 @@ jobs: | |
- if: steps.should_run.outputs.shouldrun == 'true' | ||
name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- if: steps.should_run.outputs.shouldrun == 'true' | ||
name: Check if Node.js project and has package.json | ||
id: packagejson | ||
run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT | ||
shell: bash | ||
- if: steps.packagejson.outputs.exists == 'true' | ||
name: Check package-lock version | ||
uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master | ||
id: lockversion | ||
- if: steps.packagejson.outputs.exists == 'true' | ||
name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
- name: Find YAML files | ||
run: | | ||
files=$(find examples/ \( -path 'examples/social-media/*' -prune \) -o -type f \( -name "*.yml" -o -name "*.yaml" \)) | ||
echo "::set-output name=files::$files" | ||
- name: Validate AsyncAPI documents | ||
uses: asyncapi/[email protected] | ||
with: | ||
node-version: "${{ steps.lockversion.outputs.version }}" | ||
cache: 'npm' | ||
cache-dependency-path: '**/package-lock.json' | ||
- if: steps.packagejson.outputs.exists == 'true' | ||
name: Install dependencies | ||
id: first-installation | ||
run: npm install --loglevel verbose | ||
continue-on-error: true | ||
- if: steps.first-installation.outputs.status == 'failure' && steps.packagejson.outputs.exists == 'true' | ||
name: Clear NPM cache and install deps again | ||
run: | | ||
npm cache clean --force | ||
npm install --loglevel verbose | ||
- if: steps.packagejson.outputs.exists == 'true' | ||
name: Validate examples | ||
run: npm run validate:examples | ||
command: custom | ||
arguments: | | ||
validate ${{ steps.FindYAMLFiles.outputs.files }} |