Skip to content

Commit bff204c

Browse files
committed
Add workflow to update package.json directories fields
1 parent a648b04 commit bff204c

1 file changed

Lines changed: 97 additions & 0 deletions

File tree

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
#/
2+
# @license Apache-2.0
3+
#
4+
# Copyright (c) 2022 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: package_json_directories
21+
22+
# Workflow triggers:
23+
on:
24+
# Allow the workflow to be manually run:
25+
workflow_dispatch:
26+
27+
# Run the workflow on a schedule:
28+
schedule:
29+
# Run the workflow every week on Sunday at 00:00 UTC:
30+
- cron: '0 0 * * 0'
31+
32+
# Workflow jobs:
33+
jobs:
34+
35+
# Define a job for updating `directories` fields in `package.json` files...
36+
update-package-json-directories:
37+
38+
# Define a display name:
39+
name: 'Update `directories` Fields in `package.json` Files'
40+
41+
# Define the type of virtual host machine:
42+
runs-on: ubuntu-latest
43+
44+
# Define the sequence of job steps...
45+
steps:
46+
47+
# Checkout the repository:
48+
- name: 'Checkout repository'
49+
uses: actions/checkout@v3
50+
with:
51+
# Specify whether to remove untracked files before checking out the repository:
52+
clean: false
53+
54+
# Limit clone depth to the most recent commit:
55+
fetch-depth: 1
56+
57+
# Specify whether to download Git-LFS files:
58+
lfs: false
59+
timeout-minutes: 10
60+
61+
# Install Node.js:
62+
- name: 'Install Node.js'
63+
uses: actions/setup-node@v3
64+
with:
65+
node-version: '16' # 'lts/*'
66+
timeout-minutes: 5
67+
68+
# Install dependencies (accounting for possible network failures, etc, when installing node module dependencies):
69+
- name: 'Install dependencies'
70+
run: |
71+
make install-node-modules || make install-node-modules || make install-node-modules
72+
timeout-minutes: 15
73+
74+
# Update `directories` fields in `package.json` files:
75+
- name: 'Update `directories` fields in `package.json` files'
76+
run: |
77+
node lib/node_modules/@stdlib/_tools/package-json/scripts/update_directories
78+
79+
# Create a pull request with the updated `package.json` files:
80+
- name: 'Create pull request'
81+
id: cpr
82+
uses: peter-evans/create-pull-request@v4
83+
with:
84+
title: 'Update `directories` fields in `package.json` files'
85+
body: |
86+
This PR
87+
88+
- updates the `directories` fields in `package.json` files
89+
90+
commit-message: 'Update `directories` fields in `package.json` files'
91+
committer: 'stdlib-bot <noreply@stdlib.io>'
92+
labels: |
93+
automated-pr
94+
team-reviewers: |
95+
stdlib-reviewers
96+
branch: update-package-json-directories
97+
delete-branch: true

0 commit comments

Comments
 (0)