Validate action.yml #267
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
name: Validate action.yml | |
on: | |
pull_request: | |
paths: | |
- ".github/workflows/validate-action_yml.yml" | |
- "action.yml" | |
push: | |
paths: | |
- ".github/workflows/validate-action_yml.yml" | |
- "action.yml" | |
# Scheduled trigger to catch workflow failure resulting from changes to the JSON schema | |
schedule: | |
# run every Tuesday at 3 AM UTC | |
- cron: "0 3 * * 2" | |
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch | |
workflow_dispatch: | |
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#repository_dispatch | |
repository_dispatch: | |
jobs: | |
spellcheck: | |
runs-on: ubuntu-latest | |
env: | |
JSON_SCHEMA_FOLDER: etc/json-schema | |
JSON_SCHEMA_FILENAME: github-action.json | |
steps: | |
- name: Checkout local repository | |
uses: actions/checkout@v4 | |
- name: Download JSON schema for action.yml | |
uses: carlosperate/download-file-action@v2 | |
with: | |
file-url: https://json.schemastore.org/github-action | |
location: ${{ env.JSON_SCHEMA_FOLDER }} | |
file-name: ${{ env.JSON_SCHEMA_FILENAME }} | |
- name: Install JSON schema validator | |
run: sudo npm install --global ajv-cli | |
- name: Validate action.yml | |
run: ajv -s "${{ env.JSON_SCHEMA_FOLDER }}/${{ env.JSON_SCHEMA_FILENAME }}" -d action.yml |