-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathaction.yml
More file actions
48 lines (39 loc) · 1.3 KB
/
action.yml
File metadata and controls
48 lines (39 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: "IIIF Presentation Validator"
description: "Validate IIIF JSON files in a directory using iiif-validator validate-dir"
inputs:
directory:
description: "Directory to search recursively for files"
required: true
version:
description: "IIIF Presentation version to validate against, e.g. 2.1 or 3.0. If this isn't supplied then the version will be determined by the @context in the manifest"
required: false
default: ""
extension:
description: "File extension or glob pattern to match (e.g. .json, .jsonld)"
required: false
default: ".json"
runs:
using: "composite"
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install validator
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install "${{ github.action_path }}"
- name: Validate directory
shell: bash
run: |
set -euo pipefail
CMD="iiif-validator validate-dir \"${{ inputs.directory }}\""
if [ -n "${{ inputs.version }}" ]; then
CMD="$CMD --version \"${{ inputs.version }}\""
fi
if [ -n "${{ inputs.extension }}" ]; then
CMD="$CMD --extension \"${{ inputs.extension }}\""
fi
echo "Running: $CMD"
eval $CMD