Skip to content

How to avoid git commit if one sub command in parallel a command fails #961

Answered by mrexox
OnkarRuikar asked this question in Q&A
Discussion options

You must be logged in to vote

@OnkarRuikar , I think you can use jobs for this and split your multi-commands into separate jobs:

pre-commit:
  parallel: true

  jobs:
    - name: format-non-md
      glob: "*.{js,json,yml,yaml,css,html}"
      run: yarn prettier --ignore-unknown --write {staged_files}

    - name: yarn-filecheck
      glob: "*.{svg,png,jpeg,jpg,gif}"
      run: yarn filecheck {staged_files}

    - name: markdown
      glob: "*.md"
      group:
        piped: true
        jobs:
          - run: node scripts/front-matter_linter.js --fix true {staged_files}
          - run: yarn markdownlint-cli2 --fix {staged_files}
          - run: yarn prettier --write {staged_files}
          - run: yarn node scripts/…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by mrexox
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants