Update Classic Cardtoons #7165
Workflow file for this run
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
name: Validate JSONs | |
on: [pull_request] | |
jobs: | |
verify-json-validation: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- id: files | |
uses: jitterbit/get-changed-files@v1 | |
continue-on-error: true | |
with: | |
format: 'json' | |
- id: chagedFiles | |
run: | | |
print("INITIAL INPUT IS OF TYPE: "+str(type(${{ steps.files.outputs.all }}))) | |
list_as_string = ",".join(${{ steps.files.outputs.all }}) | |
print("list_as_string: "+list_as_string) | |
print("::set-output name=FILES_LIST::"+list_as_string) | |
shell: python | |
- id: isCorrect | |
run: | | |
print("::set-output name=ERROR_VALIDITY::false") | |
for filename in "${{ steps.chagedFiles.outputs.FILES_LIST }}".split(","): | |
if "projects/" not in filename: | |
print("File "+str(filename)+" is not in projects directory!") | |
print("::set-output name=ERROR_VALIDITY::true") | |
break | |
special_characters = "\"'!@#$%^&*()-+?_=,<>" | |
if any(c in special_characters for c in filename): | |
print("File "+str(filename)+" has name with forbidden characters!") | |
print("::set-output name=ERROR_VALIDITY::true") | |
break | |
shell: python | |
- name: Try to fail for incorrect naming | |
run: | | |
echo ${{ steps.isCorrect.outputs.ERROR_VALIDITY }} | |
exit 1 | |
if: steps.isCorrect.outputs.ERROR_VALIDITY == 'true' | |
- name: Validate JSON | |
uses: docker://orrosenblatt/validate-json-action:latest | |
env: | |
INPUT_SCHEMA: /internal/policy-id-schema.json | |
INPUT_JSONS: ${{ steps.chagedFiles.outputs.FILES_LIST }} |