Skip to content

4-adding-workflows

4-adding-workflows #9

Workflow file for this run

---
name: ai-cfia workflows
on:
pull_request:
types:
- opened
- closed
- synchronize
jobs:
python-lint:
name: workflow-lint-test-python
uses: ai-cfia/github-workflows/.github/workflows/workflow-lint-test-python.yml@main
secrets: inherit
mkd-check:
name: workflow-markdown-check
uses: ai-cfia/github-workflows/.github/workflows/workflow-markdown-check.yml@main
with: # to pass inputs to called workflow
config-file-path: '.mlc_config.json'
secrets: inherit
repo-validation:
name: workflow-repo-standards-validation
uses: ai-cfia/github-workflows/.github/workflows/workflow-repo-standards-validation.yml@main
secrets: inherit
# This job wat modified to use the default yamllint configuration
# We needed to change the config of the main
# yaml-check:
# name: workflow-yaml-check
# #runs-on: ubuntu-latest
# # steps:
# # - name: yaml-lint
# # run: ai-cfia/github-workflows/.github/workflows/workflow-yaml-check.yml@main
# # - name: extension-lint
# # run: github-workflows/.yamllint.yml@main
# uses: ai-cfia/github-workflows/.github/workflows/workflow-yaml-check.yml@main
# # I need to add the extends part to change the max line length
# with:
# config-file-path: 'github-workflows/.yamllint.yml'
# secrets: inherit
yaml-check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get changed files
id: files
uses: lots0logs/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install yamllint
run: pip install yamllint
- name: Lint YAML files
run: |
files=$(echo '${{ steps.files.outputs.all }}' | jq -r '.[]')
for file in $files; do
if [[ $file == *.yml || $file == *.yaml ]]; then
# Check if a custom config path is provided and file exists
if [ -n "${{ github.event.inputs.config-file-path }}" ]; then
yamllint -c "${{ github.workspace }}/${{ github.event.inputs.config-file-path }}" "$file"
else
yamllint "$file"
fi
fi
done
shell: bash
extends: default

Check failure on line 71 in .github/workflows/workflows.yml

View workflow run for this annotation

GitHub Actions / ai-cfia workflows

Invalid workflow file

The workflow is not valid. .github/workflows/workflows.yml (Line: 71, Col: 9): Unexpected value 'extends' .github/workflows/workflows.yml (Line: 72, Col: 9): Unexpected value 'rules'

Check failure on line 71 in .github/workflows/workflows.yml

View workflow run for this annotation

GitHub Actions / ai-cfia workflows

Invalid workflow file

The workflow is not valid. .github/workflows/workflows.yml (Line: 71, Col: 9): Unexpected value 'extends' .github/workflows/workflows.yml (Line: 72, Col: 9): Unexpected value 'rules'
rules:
# 80 chars should be enough, but don't fail if a line is longer
line-length:
max: 100
level: Error