Fix/yaml spec (#30) #5
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
| # validate.yml — tests the validate GitHub Action on every PR and push to main | |
| # that touches the action definition, schema, or test fixtures. | |
| name: Validate Action | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "validate/**" | |
| - "schemas/**" | |
| - ".github/workflows/validate.yml" | |
| pull_request: | |
| paths: | |
| - "validate/**" | |
| - "schemas/**" | |
| - ".github/workflows/validate.yml" | |
| permissions: | |
| contents: read | |
| jobs: | |
| test-valid: | |
| name: Valid YAML passes | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| - uses: ./validate | |
| with: | |
| file: validate/tests/valid.yml | |
| test-invalid: | |
| name: Invalid YAML is rejected | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| - id: validate | |
| uses: ./validate | |
| with: | |
| file: validate/tests/invalid.yml | |
| continue-on-error: true | |
| - name: Assert validation failed | |
| run: | | |
| if [ "${{ steps.validate.outcome }}" != "failure" ]; then | |
| echo "Expected validation to fail for invalid.yml, but it did not." | |
| exit 1 | |
| fi | |
| echo "Validation correctly rejected invalid.yml." |