feat: wip #9705
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: Lint | |
| on: # yamllint disable-line rule:truthy | |
| push: null | |
| pull_request: null | |
| workflow_call: null | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| concurrency: | |
| # Ref: https://docs.github.com/en/actions/learn-github-actions/contexts#github-context | |
| # github.head_ref: head_ref or source branch of the pull request | |
| # github.ref: ref of the branch that triggered the workflow | |
| group: ${{ github.workflow }}-lint-${{ github.head_ref || github.ref }}-${{ github.event_name }} | |
| cancel-in-progress: true | |
| permissions: | |
| # contents permission to clone the repository | |
| contents: read | |
| packages: read | |
| # issues and pull-requests permissions to write results as pull | |
| # request comments. Omit them if you don't need summary comments | |
| issues: write | |
| pull-requests: write | |
| # To report GitHub Actions status checks. Omit if you don't need | |
| # to update commit status | |
| statuses: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| fetch-depth: 0 | |
| - name: Load super-linter configuration | |
| run: cat config/lint/super-linter.env >> "$GITHUB_ENV" | |
| - name: Super-Linter | |
| uses: super-linter/super-linter@v8.5.0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| ENABLE_GITHUB_PULL_REQUEST_SUMMARY_COMMENT: true | |
| pre_commit: | |
| concurrency: | |
| # Ref: https://docs.github.com/en/actions/learn-github-actions/contexts#github-context | |
| # github.head_ref: head_ref or source branch of the pull request | |
| # github.ref: ref of the branch that triggered the workflow | |
| group: ${{ github.workflow }}-pre-commit-${{ github.head_ref || github.ref }}-${{ github.event_name }} | |
| cancel-in-progress: true | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - name: "Run pre-commit" | |
| run: | | |
| set -o errexit | |
| set -o nounset | |
| scripts/run-pre-commit.sh | |
| fix-lint-issues: | |
| concurrency: | |
| # Ref: https://docs.github.com/en/actions/learn-github-actions/contexts#github-context | |
| # github.head_ref: head_ref or source branch of the pull request | |
| # github.ref: ref of the branch that triggered the workflow | |
| group: ${{ github.workflow }}-fix-lint-issues-${{ github.head_ref || github.ref }}-${{ github.event_name }} | |
| cancel-in-progress: true | |
| if: > | |
| github.event.pull_request.user.login != 'dependabot[bot]' | |
| permissions: | |
| # To write linting fixes | |
| contents: write | |
| packages: read | |
| # issues and pull-requests permissions to write results as pull | |
| # request comments. Omit them if you don't need summary comments | |
| issues: write | |
| pull-requests: write | |
| # To report GitHub Actions status checks. Omit if you don't need | |
| # to update commit status | |
| statuses: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: true | |
| fetch-depth: 0 | |
| - name: Load super-linter configuration | |
| run: cat config/lint/super-linter.env >> "$GITHUB_ENV" | |
| - name: Load super-linter fix mode configuration | |
| run: cat config/lint/super-linter-fix-mode.env >> "$GITHUB_ENV" | |
| - name: Super-Linter | |
| uses: super-linter/super-linter@v8.5.0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| ENABLE_GITHUB_PULL_REQUEST_SUMMARY_COMMENT: true | |
| - name: Commit and push linting fixes | |
| # Run even if the previous step failed because super-linter might | |
| # exit with an error even if some linters automatically fixed all the | |
| # issues that they found | |
| if: > | |
| github.event_name == 'pull_request' && | |
| github.ref_name != github.event.repository.default_branch && | |
| !cancelled() | |
| uses: stefanzweifel/git-auto-commit-action@v5.2.0 | |
| with: | |
| branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }} | |
| commit_message: "chore: fix linting issues" | |
| commit_user_name: super-linter | |
| commit_user_email: super-linter@super-linter.dev |