Skip to content

Add schema definition #15

Add schema definition

Add schema definition #15

Workflow file for this run

name: PR checks fon algorithm submission
on:
pull_request:
paths:
- 'algorithms/*.yaml'
push:
paths:
- 'algorithms/*.yaml'
env:
IMAGE_NAME: ${{ github.repository }}-algo-checks
SCHEMA: "config/schema.json"
jobs:
check_yaml:
runs-on: ubuntu-latest
container:
image: ghcr.io/${{ env.IMAGE_NAME }}

Check failure on line 20 in .github/workflows/pr-check.yml

View workflow run for this annotation

GitHub Actions / PR checks fon algorithm submission

Invalid workflow file

The workflow is not valid. .github/workflows/pr-check.yml (Line: 20, Col: 14): Unrecognized named-value: 'env'. Located at position 1 within expression: env.IMAGE_NAME
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
steps:
- name: find algorithm files
run: |
{
echo 'FILELIST<<EOF'
find ./algorithms -name '*.yaml' -print
echo EOF
} >> "$GITHUB_ENV"
- name: Convert and validate using jsonschema
run: |
for algo in ${FILELIST}; do
yq -o json $algo > algo.json \
&& jsonschema-cli -i algo.json ${{ env.SCHEMA }}
done
rm algo.json
check_image:
runs-on: ubuntu-latest
steps:
- name: find algorithm files
run: |
{
echo 'FILELIST<<EOF'
find ./algorithms -name '*.yaml' -print
echo EOF
} >> "$GITHUB_ENV"
- name: Pull image
run: |
for algo in ${FILELIST}; do
docker pull $(sed 's/^image: \+\(.*\)$/\1/' $algo)
done