-
Notifications
You must be signed in to change notification settings - Fork 297
85 lines (74 loc) · 2.65 KB
/
Copy pathadd-tools-api-docs.yml
File metadata and controls
85 lines (74 loc) · 2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Checkout tools code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
repository: "nf-core/tools"
ref: ${{ inputs.ref_name }}
path: "tools"
- name: setup node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: "24"
- name: Install dependencies
run: |
npm install remark unist-util-visit
- name: setup uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- name: install nf-core
run: |
cd tools
uv sync --all-extras
- name: run API generation script
run: |
cd tools
uv add sphinx-markdown-builder
if [ -f docs/api/requirements.txt ]; then
uv add -r docs/api/requirements.txt
fi
uv run bash docs/api/generate-api-docs.sh --release ${{ inputs.ref_name }}
- name: remove tools code
run: rm -rf tools
- uses: j178/prek-action@6ad80277337ad479fe43bd70701c3f7f8aa74db3 # v2
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@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8
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