Skip to content

Commit d831656

Browse files
committed
Separate out workflow that can be manually triggered
1 parent b3a710c commit d831656

2 files changed

Lines changed: 106 additions & 3 deletions

File tree

.github/workflows/markdown_tocs.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ on:
2727
types:
2828
- closed
2929

30-
# Allow the workflow to be manually run:
31-
workflow_dispatch:
32-
3330
# Workflow jobs:
3431
jobs:
3532

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
#/
2+
# @license Apache-2.0
3+
#
4+
# Copyright (c) 2021 The Stdlib Authors.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#/
18+
19+
# Workflow name:
20+
name: markdown_tocs_dispatch
21+
22+
# Workflow triggers:
23+
on:
24+
# Allow the workflow to be manually run:
25+
workflow_dispatch:
26+
27+
# Workflow jobs:
28+
jobs:
29+
30+
# Define a job for updating namespace table of contents...
31+
update:
32+
33+
# Define a display name:
34+
name: 'Update namespace ToCs'
35+
36+
# Define the type of virtual host machine:
37+
runs-on: ubuntu-latest
38+
39+
# Define the sequence of job steps...
40+
steps:
41+
42+
# Checkout the repository:
43+
- name: 'Checkout repository'
44+
uses: actions/checkout@v2
45+
with:
46+
# Specify whether to remove untracked files before checking out the repository:
47+
clean: true
48+
49+
# Limit clone depth to the most recent commit:
50+
fetch-depth: 1
51+
52+
# Specify whether to download Git-LFS files:
53+
lfs: false
54+
timeout-minutes: 10
55+
56+
# Install Node.js:
57+
- name: 'Install Node.js'
58+
uses: actions/setup-node@v2
59+
with:
60+
node-version: '16' # 'lts/*'
61+
timeout-minutes: 5
62+
63+
# Install dependencies (accounting for possible network failures, etc, when installing node module dependencies):
64+
- name: 'Install dependencies'
65+
run: |
66+
make install-node-modules || make install-node-modules || make install-node-modules
67+
timeout-minutes: 15
68+
69+
# Initialize development environment:
70+
- name: 'Initialize development environment'
71+
run: |
72+
make init
73+
timeout-minutes: 5
74+
75+
# Generate list of namespace READMEs:
76+
- name: 'Generate list of namespace READMEs'
77+
run: |
78+
echo "::set-output name=files::$( make list-pkgs-namespace-readmes | tr '\n' ' ' )"
79+
id: namespace_files
80+
81+
# Update namespace table of contents:
82+
- name: 'Update tables of contents'
83+
run: |
84+
make markdown-namespace-tocs-files FILES="${{ steps.namespace_files.outputs.files }}"
85+
make markdown-pkg-urls-files FILES="${{ steps.namespace_files.outputs.files }}"
86+
timeout-minutes: 15
87+
88+
# Create a pull request with the updated tables of contents:
89+
- name: 'Create pull request'
90+
uses: peter-evans/create-pull-request@v3
91+
with:
92+
title: 'Update namespace table of contents'
93+
body: |
94+
This PR
95+
96+
- updates namespace table of contents
97+
98+
commit-message: 'Update namespace table of contents'
99+
committer: 'stdlib-bot <noreply@stdlib.io>'
100+
labels: |
101+
documentation
102+
automated-pr
103+
team-reviewers: |
104+
stdlib-reviewers
105+
branch: update-namespace-tocs
106+
delete-branch: true

0 commit comments

Comments
 (0)