Skip to content

Add --help-json flag for machine-readable CLI help #5370

Add --help-json flag for machine-readable CLI help

Add --help-json flag for machine-readable CLI help #5370

Workflow file for this run

name: Fix linting from a comment
on:
issue_comment:
types: [created] # Add "@nf-core-bot fix linting" as a PR comment to trigger this workflow.
jobs:
fix-linting:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: branch-deploy
id: branch-deploy
uses: github/branch-deploy@fded0351b6b79f854b335c11b3d93063461dd288 # v11.1.2
with:
trigger: "@nf-core-bot fix linting"
reaction: "eyes"
stable_branch: "dev"
# Use the @nf-core-bot token to check out so we can push later
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
token: ${{ secrets.nf_core_bot_auth_token }}
# Action runs on the issue comment, so we don't get the PR by default
# Use the gh cli to check out the PR
- name: Checkout Pull Request
run: gh pr checkout ${{ github.event.issue.number }}
env:
GITHUB_TOKEN: ${{ secrets.nf_core_bot_auth_token }}
# Install and run prek
- name: Run prek
id: prek
uses: j178/prek-action@6ad80277337ad479fe43bd70701c3f7f8aa74db3 # v2
with:
extra-args: --config .pre-commit-config.yaml --all-files
continue-on-error: true
# indication that the linting has finished
- name: react if linting finished succesfully
if: steps.prek.outcome == 'success'
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5
with:
comment-id: ${{ github.event.comment.id }}
reactions: "+1"
- name: Commit & push changes
id: commit-and-push
if: steps.prek.outcome == 'failure'
run: |
git config user.email "core@nf-co.re"
git config user.name "nf-core-bot"
git config push.default upstream
git add .
git status
git commit -m "[automated] Fix code linting"
git push
- name: react if linting errors were fixed
id: react-if-fixed
if: steps.commit-and-push.outcome == 'success'
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5
with:
comment-id: ${{ github.event.comment.id }}
reactions: hooray
- name: react if linting errors were not fixed
if: steps.commit-and-push.outcome == 'failure'
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5
with:
comment-id: ${{ github.event.comment.id }}
reactions: confused
- name: react if linting errors were not fixed
if: steps.commit-and-push.outcome == 'failure'
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5
with:
issue-number: ${{ github.event.issue.number }}
body: |
@${{ github.actor }} I tried to fix the linting errors, but it didn't work. Please fix them manually.
See [CI log](https://github.com/nf-core/tools/actions/runs/${{ github.run_id }}) for more details.