Skip to content

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

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

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

Workflow file for this run

name: Update CHANGELOG.md
on:
issue_comment:
types: [created] # Add "@nf-core-bot changelog" as a PR comment to trigger this workflow.
jobs:
update_changelog:
runs-on: ubuntu-latest
if: contains(github.event.comment.body, '@nf-core-bot changelog')
steps:
- name: branch-deploy
id: branch-deploy
if: github.event_name == 'issue_comment'
uses: github/branch-deploy@fded0351b6b79f854b335c11b3d93063461dd288 # v11.1.2
with:
trigger: "@nf-core-bot changelog"
reaction: "eyes"
stable_branch: "dev"
- 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 GitHub CLI to check out the PR:
- name: Checkout Pull Request
env:
GH_TOKEN: ${{ secrets.NF_CORE_BOT_AUTH_TOKEN }}
run: |
PR_NUMBER="${{ github.event.issue.number }}"
gh pr checkout $PR_NUMBER
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.14"
- name: Install packages
run: pip install pyyaml
- name: Update CHANGELOG.md from the PR title
env:
COMMENT: ${{ github.event.comment.body }}
GH_TOKEN: ${{ secrets.NF_CORE_BOT_AUTH_TOKEN }}
PR_NUMBER: ${{ github.event.issue.number || github.event.pull_request.number }}
PR_TITLE: ${{ github.event.issue.title || github.event.pull_request.title }}
run: |
python ${GITHUB_WORKSPACE}/.github/workflows/changelog.py
- name: Check if CHANGELOG.md actually changed
id: file_changed
run: |
# Show the diff for debugging
git diff -- ${GITHUB_WORKSPACE}/CHANGELOG.md
# Check if file has unstaged changes
[ -n "$(git diff -- ${GITHUB_WORKSPACE}/CHANGELOG.md)" ] && file_changed="TRUE" || file_changed="FALSE"
echo "File changed: $file_changed"
echo "changed=$file_changed" >> $GITHUB_OUTPUT
- name: Set up Python 3.14
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.14"
- name: Run pre-commit rules with prek
uses: j178/prek-action@6ad80277337ad479fe43bd70701c3f7f8aa74db3 # v2
continue-on-error: true
with:
extra-args: --config .pre-commit-config.yaml --all-files
- name: Commit and push changes
if: steps.file_changed.outputs.changed == 'TRUE'
env:
GH_TOKEN: ${{ secrets.NF_CORE_BOT_AUTH_TOKEN }}
run: |
git config user.email "core@nf-co.re"
git config user.name "nf-core-bot"
git add ${GITHUB_WORKSPACE}/CHANGELOG.md
git status
git commit -m "[automated] Update CHANGELOG.md [skip ci]"
git push