fix: Prettier action to write to files #144
Workflow file for this run
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: Super Linter | |
on: # yamllint disable-line rule:truthy | |
push: null | |
pull_request: null | |
permissions: | |
contents: read | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: read | |
# To report GitHub Actions status checks | |
statuses: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
# super-linter needs the full git history to get the | |
# list of files that changed across commits | |
fetch-depth: 0 | |
- name: Super-linter | |
uses: super-linter/[email protected] # x-release-please-version | |
env: | |
# To report GitHub Actions status checks | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
fix-lint-issues: | |
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: Super-Linter | |
uses: super-linter/[email protected] # x-release-please-version | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Set your fix mode variables to true | |
FIX_SHELL_SHFMT: true | |
FIX_YAML_PRETTIER: true | |
FIX_MARKDOWN: true | |
# To reuse the same Super-linter configuration that you use in the | |
# lint job without duplicating it, see | |
# https://github.com/super-linter/super-linter/blob/main/docs/run-linter-locally.md#share-environment-variables-between-environments | |
- name: Commit and push linting fixes | |
# Run only on: | |
# - Pull requests | |
# - Not on the default branch | |
if: > | |
github.event_name == 'pull_request' && | |
github.ref_name != github.event.repository.default_branch | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
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: [email protected] | |
# on: | |
# push: | |
# branches: [master] | |
# pull_request: | |
# branches: [master] | |
# # Allows you to run this workflow manually from the Actions tab | |
# workflow_dispatch: | |
# # Permissions for the GITHUB_TOKEN. | |
# permissions: | |
# contents: write # To write linting fixes | |
# statuses: write # To write Super-linter status checks | |
# packages: read | |
# jobs: | |
# lint: | |
# # If the branch is from the release please workflow, don't trigger the linter. It is handled in the prettier workflow. | |
# # No current other way to filter on pull request triggers using the source branch as well as the target branch. | |
# if: ${{ github.head_ref != 'release-please--branches--master' }} # Access using the github context. Curly braces are technically optional in if expressions. | |
# name: Lint code base | |
# uses: andrew-field/reusable-workflows/.github/workflows/super-linter.yml@master |