fix: minor configuration updates #8538
This file contains 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: read | |
packages: read | |
statuses: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
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@v7.2.0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
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@v4 | |
- 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 | |
permissions: | |
# To write linting fixes | |
contents: write | |
# To write Super-linter status checks | |
statuses: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
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@v7.2.0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- 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.0.1 | |
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 |