This repository was archived by the owner on Sep 9, 2025. It is now read-only.
build(deps): bump tj-actions/changed-files from dcc7a0cba800f454d79fff4b993e8c3555bcc0a8 to 94d97fe3f88298bf8b2f2db6fa2ab150f3c1ab77 #3206
Workflow file for this run
This file contains hidden or 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
| # SPDX-License-Identifier: Apache-2.0 | |
| name: Lint compositional_skills and knowledge | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - compositional_skills/**/qna.yaml | |
| - knowledge/**/qna.yaml | |
| - '.github/workflows/lint.yml' # This workflow | |
| - 'scripts/**' # Scripts used by this workflow | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - compositional_skills/**/*.yaml | |
| - compositional_skills/**/*.yml | |
| - knowledge/**/*.yaml | |
| - knowledge/**/*.yml | |
| - '.github/workflows/lint.yml' # This workflow | |
| - 'scripts/**' # Scripts used by this workflow | |
| env: | |
| LC_ALL: en_US.UTF-8 | |
| defaults: | |
| run: | |
| shell: bash | |
| permissions: | |
| contents: read | |
| jobs: | |
| yamllint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: "Harden Runner" | |
| uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0 | |
| with: | |
| egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs | |
| - name: "Checkout" | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: "Setup Python" | |
| uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 | |
| with: | |
| python-version: "3.11" | |
| - name: "Install Python Packages" | |
| run: | | |
| pip install -r scripts/requirements.txt | |
| - name: "Find changed skills and knowledge files" | |
| id: changed-files | |
| uses: tj-actions/changed-files@94d97fe3f88298bf8b2f2db6fa2ab150f3c1ab77 # v45.0.7 | |
| with: | |
| files: | | |
| compositional_skills/**/*.yaml | |
| compositional_skills/**/*.yml | |
| knowledge/**/*.yaml | |
| knowledge/**/*.yml | |
| - name: "Check changed YAML file contents" | |
| if: ${{ fromJSON(steps.changed-files.outputs.any_changed) }} | |
| run: | | |
| scripts/check-yaml.py ${{ steps.changed-files.outputs.all_changed_files }} | |
| env: | |
| TAXONOMY_FOLDERS: >- | |
| compositional_skills | |
| knowledge | |
| - name: "Check all YAML file contents" | |
| if: ${{ !fromJSON(steps.changed-files.outputs.any_changed) }} | |
| run: | | |
| read -ra folders <<< "${TAXONOMY_FOLDERS}" | |
| # shellcheck disable=SC2046 | |
| scripts/check-yaml.py $(find "${folders[@]}" -name "qna.yaml" -print) | |
| env: | |
| SCHEMA_VERSION: 0 # use the schema version specified in the "version" key | |
| TAXONOMY_FOLDERS: >- | |
| compositional_skills | |
| knowledge | |
| - name: "Save Pull Request number" | |
| if: ${{ (github.event_name == 'pull_request') && (github.repository == 'instructlab/taxonomy') }} | |
| run: | | |
| echo "${PULL_REQUEST_NUMBER}" > pull_request_number.txt | |
| env: | |
| PULL_REQUEST_NUMBER: ${{ fromJSON(steps.changed-files.outputs.any_changed) && github.event.number || '0' }} | |
| - name: "Upload Pull Request number" | |
| if: ${{ (github.event_name == 'pull_request') && (github.repository == 'instructlab/taxonomy') }} | |
| uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1 | |
| with: | |
| name: pull_request_number | |
| path: pull_request_number.txt | |
| if-no-files-found: error | |
| retention-days: 5 |