Test automated LinkML validation #7
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: LinkML Linting GitHub Action | |
on: | |
- pull_request | |
jobs: | |
linkml: | |
permissions: | |
contents: write | |
pull-requests: write | |
name: LinkML Linting | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install linkml | |
- name: Run LinkML Linting | |
run: | | |
## Results file header and basic formatting | |
printf '# LinkML Linting Results \n' > linting-results.md | |
printf "$(linkml --version) linting found the following issues: \n\n" >> linting-results.md | |
printf "> [!WARNING]\n" >> linting-results.md | |
## Lint the schema, and further format | |
linkml lint src/mixs/schema/mixs.yaml >> linting-results.md | |
sed -i 's/^ warning/> - warning /' linting-results.md | |
# If the above check failed, post a comment on the PR explaining the failure | |
- name: Post PR comment | |
if: failure() | |
uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2 | |
with: | |
message-path: linting-results.md | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
allow-repeats: true |