-
Notifications
You must be signed in to change notification settings - Fork 194
86 lines (74 loc) · 2.52 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@v4
- name: Checkout tools code
uses: actions/checkout@v4
with:
repository: 'nf-core/tools'
ref: ${{ inputs.ref_name }}
path: 'tools'
- name: setup node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: |
npm install remark unist-util-visit
# Install pre-commit
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # 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@5e914681df9dc83aa4e4905692ca88beb2f9e91f # 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