Skip to content

Open PR with tools API docs based on webhook call #268

Open PR with tools API docs based on webhook call

Open PR with tools API docs based on webhook call #268

name: Open PR with tools API docs based on webhook call
on:
workflow_dispatch:
inputs:
ref_name:
description: "The name of the release branch"
required: true
default: "dev"
jobs:
api-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
- name: Checkout tools code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
with:
repository: "nf-core/tools"
ref: ${{ inputs.ref_name }}
path: "tools"
- name: setup node
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6
with:
node-version: "24"
- name: Install dependencies
run: |
npm install remark unist-util-visit
- name: install nf-core
run: |
cd tools
pip install --upgrade -r requirements-dev.txt -e .
- name: run API generation script
run: |
cd tools
pip install sphinx-markdown-builder
bash docs/api/generate-api-docs.sh --release ${{ inputs.ref_name }}
- name: remove tools code
run: rm -rf tools
- uses: j178/prek-action@91fd7d7cf70ae1dee9f4f44e7dfa5d1073fe6623 # v1
with:
install-only: true
- name: Run prek
id: pre-commit
run: git add . && prek run --all-files
continue-on-error: true
- name: Commit & push changes
id: commit-and-push
run: |
git config user.email "core@nf-co.re"
git config user.name "nf-core-bot"
# restore package.json changes
git restore package.json
git restore package-lock.json
git add .
git status
git commit -m "[automated] Update nf-core/tools API docs for ${{ inputs.ref_name }}"
- name: Create PR
uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676 # v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update nf-core/tools API docs for ${{inputs.ref_name}}
title: Update nf-core/tools API docs for ${{inputs.ref_name}}
body: |
This PR updates the nf-core/tools API docs for ${{inputs.ref_name}}.
Please review the changes and merge if they look good.
branch: "update-api-docs-${{inputs.ref_name}}"
delete-branch: true
base: "main"
draft: false