TEMP/check permissions #3
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: Yamllint | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| strict: | ||
| description: 'Whether to enable strict mode for yamllint.' | ||
| type: boolean | ||
| required: false | ||
| default: false | ||
| jobs: | ||
| yamllint: | ||
| name: 'Lint Yaml' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| runs-on: ubuntu-latest | ||
| - name: Check what permission are needed | ||
| uses: GitHubSecurityLab/actions-permissions/monitor@v1 | ||
| with: | ||
| config: ${{ vars.PERMISSIONS_MONITOR_CONFIG }} | ||
| - name: Checkout code | ||
| uses: actions/checkout@v5 | ||
| - name: Check for existence of a Yamllint config file | ||
| id: has_config | ||
| uses: andstor/file-existence-action@v3 | ||
| with: | ||
| files: ".yamllint.y*ml" | ||
| - name: Run Yamllint on all yaml files in repo | ||
| if: ${{ steps.has_config.outputs.files_exists == 'true' }} | ||
| run: yamllint . --format colored ${{ inputs.strict && '--strict' || '' }} | ||
| - name: Pipe Yamllint results on to GH for inline display | ||
| if: ${{ failure() && github.event_name == 'pull_request' }} | ||
| run: yamllint . --format github ${{ inputs.strict && '--strict' || '' }} | ||
| actionlint: | ||
| name: 'Check GHA workflows' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check what permission are needed | ||
| uses: GitHubSecurityLab/actions-permissions/monitor@v1 | ||
| with: | ||
| config: ${{ vars.PERMISSIONS_MONITOR_CONFIG }} | ||
| - name: Checkout code | ||
| uses: actions/checkout@v5 | ||
| - name: Add problem matcher | ||
| if: ${{ github.event_name == 'pull_request' }} | ||
| shell: bash | ||
| run: | | ||
| curl -o actionlint-matcher.json https://raw.githubusercontent.com/rhysd/actionlint/main/.github/actionlint-matcher.json | ||
| echo "::add-matcher::actionlint-matcher.json" | ||
| - name: Check workflow files | ||
| uses: docker://rhysd/actionlint:latest | ||
| with: | ||
| args: -color | ||