Refactoring the action from a composite to Node action. This change improves security through pinning of packages as well as better test-ability and error handling. Reviewed-on: #47 Co-authored-by: Timo Behrendt <t.behrendt@t00n.de> Co-committed-by: Timo Behrendt <t.behrendt@t00n.de>
This commit was merged in pull request #47.
This commit is contained in:
+2
-23
@@ -8,26 +8,5 @@ inputs:
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||
with:
|
||||
node-version: "latest"
|
||||
- name: Extract schema
|
||||
shell: bash
|
||||
run: |
|
||||
schema=$(jq -r '.["$schema"]' < ${{ inputs.json-file }})
|
||||
if [ -n "$schema" ]; then
|
||||
curl -s $schema > schema.json
|
||||
else
|
||||
echo "No schema found"
|
||||
exit 0
|
||||
fi
|
||||
- name: Update the schema to the latest version
|
||||
shell: bash
|
||||
run: |
|
||||
npx ajv-cli migrate -s schema.json -o schema.json
|
||||
- name: Validate JSON
|
||||
shell: bash
|
||||
run: |
|
||||
npx ajv-cli validate -s schema.json -d ${{ inputs.json-file }} --strict=false
|
||||
using: "node24"
|
||||
main: "dist/index.js"
|
||||
|
||||
Reference in New Issue
Block a user