forked from stdlib-js/stdlib
-
Notifications
You must be signed in to change notification settings - Fork 0
143 lines (118 loc) · 4.98 KB
/
update_contributors.yml
File metadata and controls
143 lines (118 loc) · 4.98 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#/
# @license Apache-2.0
#
# Copyright (c) 2022 The Stdlib Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#/
# Workflow name:
name: update_contributors
# Workflow triggers:
on:
schedule:
# Run the workflow once a day at 2:00 AM UTC:
- cron: '0 2 * * *'
# Allow the workflow to be manually run:
workflow_dispatch:
# Global permissions:
permissions:
# Allow read-only access to the repository contents:
contents: read
# Workflow jobs:
jobs:
# Define a job for updating the contributors list...
update-contributors:
# Define a display name:
name: 'Update contributors'
# Ensure the job does not run on forks:
if: github.repository == 'stdlib-js/stdlib'
# Define the type of virtual host machine:
runs-on: ubuntu-latest
# Define the sequence of job steps...
steps:
# Checkout the repository:
- name: 'Checkout repository'
# Pin action to full length commit SHA
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
# Specify whether to remove untracked files before checking out the repository:
clean: true
# Refers to the development branch:
ref: 'develop'
# Fetch entire history:
fetch-depth: 0
# Specify whether to download Git-LFS files:
lfs: false
# Avoid storing GitHub token in local Git configuration:
persist-credentials: false
timeout-minutes: 10
# Update the contributors list:
- name: 'Update contributors'
id: update-contributors
run: |
make update-contributors
# Stage *all* tracked and untracked changes first...
git add -A
# If the index is identical to HEAD, nothing real changed:
if git diff --cached --quiet; then
echo "No changes to commit."
echo "changed=false" >> $GITHUB_OUTPUT
else
echo "Changes detected."
echo "changed=true" >> $GITHUB_OUTPUT
fi
# Import GPG key to sign commits:
- name: 'Import GPG key to sign commits'
# Pin action to full length commit SHA
uses: crazy-max/ghaction-import-gpg@e89d40939c28e39f97cf32126055eeae86ba74ec # v6.3.0
with:
gpg_private_key: ${{ secrets.STDLIB_BOT_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.STDLIB_BOT_GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
# Create a pull request:
- name: 'Create pull request'
if: steps.update-contributors.outputs.changed == 'true'
# Pin action to full length commit SHA
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
id: cpr
with:
title: 'docs: update list of contributors'
body: |
This PR
- updates the list of contributors
## Reviewer Checklist
- [ ] For any **new contributors**, check if their full names are listed on their GitHub profile or in social links.
- [ ] If so, on the PR branch **update** the `.mailmap` file accordingly to ensure proper attribution.
- [ ] If updating `.mailmap`, **regenerate** the contributors file by running `make update-contributors` on the PR branch afterward.
- [ ] Approve the PR after verifying the changes.
commit-message: 'docs: update list of contributors'
committer: 'stdlib-bot <82920195+stdlib-bot@users.noreply.github.com>'
signoff: true
token: ${{ secrets.STDLIB_BOT_PAT_REPO_WRITE }}
labels: |
documentation
automated-pr
team-reviewers: |
reviewers
branch: update-contributors
delete-branch: true
# Create a pull request summary:
- name: 'Create summary'
if: steps.update-contributors.outputs.changed == 'true'
run: |
echo "# :tada: Pull Request created! :tada:" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Pull request ${{ steps.cpr.outputs.pull-request-number }} was successfully ${{ steps.cpr.outputs.pull-request-operation }}."
echo ":link: [${{ steps.cpr.outputs.pull-request-url }}](${{ steps.cpr.outputs.pull-request-url }})." >> $GITHUB_STEP_SUMMARY
echo "Head SHA: [${{ steps.cpr.outputs.pull-request-head-sha }}](${{ steps.cpr.outputs.pull-request-url }}/commits/${{ steps.cpr.outputs.pull-request-head-sha }})." >> $GITHUB_STEP_SUMMARY