-
Notifications
You must be signed in to change notification settings - Fork 220
86 lines (74 loc) · 2.65 KB
/
add-tools-api-docs.yml
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
86
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Checkout tools code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
repository: "nf-core/tools"
ref: ${{ inputs.ref_name }}
path: "tools"
- name: setup node
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4
with:
node-version: "20"
- name: Install dependencies
run: |
npm install remark unist-util-visit
# Install pre-commit
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
with:
python-version: 3.11
# install prettier plugins
- run: npm install --only=dev
- name: Install pre-commit
run: pip install pre-commit
- 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
- name: Run pre-commit
id: pre-commit
run: git add . && pre-commit run --all-files
continue-on-error: true
- name: Commit & push changes
id: commit-and-push
run: |
git config user.email "[email protected]"
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@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # 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