feat(ci): add YAML and GitHub Actions lint analysis for PRs #20
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
| name: Self — PR Validation | |
| on: | |
| pull_request: | |
| branches: | |
| - develop | |
| - main | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| - edited | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| issues: write | |
| jobs: | |
| # ----------------- PR Validation ----------------- | |
| validation: | |
| uses: ./.github/workflows/pr-validation.yml | |
| with: | |
| check_changelog: false | |
| enforce_source_branches: true | |
| allowed_source_branches: "develop|hotfix/*" | |
| target_branches_for_source_check: "main" | |
| secrets: inherit | |
| # ----------------- Changed Files Detection ----------------- | |
| changed-files: | |
| name: Detect Changed Files | |
| runs-on: blacksmith-4vcpu-ubuntu-2404 | |
| outputs: | |
| yaml_files: ${{ steps.detect.outputs.yaml-files }} | |
| workflow_files: ${{ steps.detect.outputs.workflow-files }} | |
| action_files: ${{ steps.detect.outputs.action-files }} | |
| markdown_files: ${{ steps.detect.outputs.markdown-files }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Detect changed files | |
| id: detect | |
| uses: ./src/config/changed-workflows | |
| with: | |
| github-token: ${{ github.token }} | |
| # ----------------- YAML Lint ----------------- | |
| yamllint: | |
| name: YAML Lint | |
| runs-on: blacksmith-4vcpu-ubuntu-2404 | |
| needs: changed-files | |
| if: needs.changed-files.outputs.yaml_files != '' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: YAML Lint | |
| uses: ./src/lint/yamllint | |
| with: | |
| file-or-dir: ${{ needs.changed-files.outputs.yaml_files }} | |
| # ----------------- Action Lint ----------------- | |
| actionlint: | |
| name: Action Lint | |
| runs-on: blacksmith-4vcpu-ubuntu-2404 | |
| needs: changed-files | |
| if: needs.changed-files.outputs.workflow_files != '' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Action Lint | |
| uses: ./src/lint/actionlint | |
| with: | |
| files: ${{ needs.changed-files.outputs.workflow_files }} | |
| # ----------------- Pinned Actions Check ----------------- | |
| pinned-actions: | |
| name: Pinned Actions Check | |
| runs-on: blacksmith-4vcpu-ubuntu-2404 | |
| needs: changed-files | |
| if: needs.changed-files.outputs.action_files != '' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Pinned Actions Check | |
| uses: ./src/lint/pinned-actions | |
| with: | |
| files: ${{ needs.changed-files.outputs.action_files }} | |
| # ----------------- Markdown Link Check ----------------- | |
| markdown-link-check: | |
| name: Markdown Link Check | |
| runs-on: blacksmith-4vcpu-ubuntu-2404 | |
| needs: changed-files | |
| if: needs.changed-files.outputs.markdown_files != '' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Markdown Link Check | |
| uses: ./src/lint/markdown-link-check | |
| with: | |
| file-path: ${{ needs.changed-files.outputs.markdown_files }} | |
| # ----------------- Spelling Check ----------------- | |
| typos: | |
| name: Spelling Check | |
| needs: changed-files | |
| runs-on: blacksmith-4vcpu-ubuntu-2404 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Spelling Check | |
| uses: ./src/lint/typos |