Skip to content

Commit dcbd949

Browse files
committed
build: add autoclose jobs
1 parent 1fce730 commit dcbd949

File tree

1 file changed

+115
-1
lines changed

1 file changed

+115
-1
lines changed

.github/workflows/autoclose.yml

Lines changed: 115 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
editorconfig:
3232

3333
# Define job name:
34-
name: 'Check for label'
34+
name: 'Check for EditorConfig label'
3535

3636
# Only run this job if the pull request has a specific label:
3737
if: "${{ github.event.label.name == 'autoclose: EditorConfig' }}"
@@ -60,3 +60,117 @@ jobs:
6060
Per the guidelines outlined in our [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md), you should download and setup [EditorConfig](http://editorconfig.org/) to ensure that files are automatically configured to use expected indentation and line endings.
6161
6262
Thank you again for your interest in stdlib, and we look forward to reviewing your future contriubtions.
63+
64+
# Define a job which closes a pull request if a contributor failed to follow contributing guidelines:
65+
contributor_guidelines:
66+
67+
# Define job name:
68+
name: 'Check for contributor guidelines label'
69+
70+
# Only run this job if the pull request has a specific label:
71+
if: "${{ github.event.label.name == 'autoclose: Contributor Guidelines' }}"
72+
73+
# Define job permissions:
74+
permissions:
75+
contents: read
76+
pull-requests: write
77+
78+
# Define the type of virtual host machine:
79+
runs-on: ubuntu-latest
80+
81+
# Define the sequence of job steps:
82+
steps:
83+
84+
# Close the pull request:
85+
- name: 'Close pull request'
86+
run: gh pr close "$NUMBER" --comment "$BODY"
87+
env:
88+
GH_TOKEN: ${{ secrets.STDLIB_BOT_GITHUB_TOKEN }}
89+
GH_REPO: ${{ github.repository }}
90+
NUMBER: ${{ github.event.pull_request.number }}
91+
BODY: |
92+
Thank you for working on this pull request. However, we cannot accept your contribution as this pull request does not follow our [contributing guidelines](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md).
93+
94+
Per the guidelines outlined in our [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md), you should have setup your local development environment such that automated development processes for linting, license verification, and unit testing can run prior to authoring commits and pushing changes. We encourage you to refer to that guide **before** continuing to work on this pull request.
95+
96+
Thank you again for your interest in stdlib, and we look forward to reviewing your future contriubtions.
97+
98+
# Define a job which closes a pull request if a contributor failed to follow project conventions:
99+
project_conventions:
100+
101+
# Define job name:
102+
name: 'Check for project conventions label'
103+
104+
# Only run this job if the pull request has a specific label:
105+
if: "${{ github.event.label.name == 'autoclose: Project Conventions' }}"
106+
107+
# Define job permissions:
108+
permissions:
109+
contents: read
110+
pull-requests: write
111+
112+
# Define the type of virtual host machine:
113+
runs-on: ubuntu-latest
114+
115+
# Define the sequence of job steps:
116+
steps:
117+
118+
# Close the pull request:
119+
- name: 'Close pull request'
120+
run: gh pr close "$NUMBER" --comment "$BODY"
121+
env:
122+
GH_TOKEN: ${{ secrets.STDLIB_BOT_GITHUB_TOKEN }}
123+
GH_REPO: ${{ github.repository }}
124+
NUMBER: ${{ github.event.pull_request.number }}
125+
BODY: |
126+
Thank you for working on this pull request. However, we cannot accept your contribution as this pull request does not follow project conventions.
127+
128+
We place a high value on consistency throughout the stdlib codebase, and this pull request was found to significantly deviate from stdlib conventions. We encourage you to closely examine other packages in stdlib and attempt to emulate the practices and conventions found therein.
129+
130+
- If you are attempting to contribute a new package, sometimes the best approach is to simply copy the contents of an existing package and then modify the minimum amount necessary to implement the feature (e.g., changing descriptions, parameter names, and implementation).
131+
- If you are contributing tests, find a package implementing a similar feature and emulate the tests of that package.
132+
- If you are updating documentation, examine several similar packages and emulate the tests, style, and prose of those packages.
133+
134+
In short, the more effort you put in to ensure that your contribution looks and feels like stdlib--including variables names, bracket spacing, line breaks, etc--the more likely that your contribution will be reviewed and ultimately accepted. We encourage you to study the codebase **before** continuing to work on this pull request.
135+
136+
Thank you again for your interest in stdlib, and we look forward to reviewing your future contriubtions.
137+
138+
# Define a job which closes a pull request if a pull request is considered spam:
139+
spam:
140+
141+
# Define job name:
142+
name: 'Check for spam label'
143+
144+
# Only run this job if the pull request has a specific label:
145+
if: "${{ github.event.label.name == 'autoclose: Spam' }}"
146+
147+
# Define job permissions:
148+
permissions:
149+
contents: read
150+
pull-requests: write
151+
152+
# Define the type of virtual host machine:
153+
runs-on: ubuntu-latest
154+
155+
# Define the sequence of job steps:
156+
steps:
157+
158+
# Close the pull request:
159+
- name: 'Close pull request'
160+
run: gh pr close "$NUMBER" --comment "$BODY"
161+
env:
162+
GH_TOKEN: ${{ secrets.STDLIB_BOT_GITHUB_TOKEN }}
163+
GH_REPO: ${{ github.repository }}
164+
NUMBER: ${{ github.event.pull_request.number }}
165+
BODY: |
166+
Thank you for working on this pull request. However, we cannot accept your contribution as this pull request does not meet the standards of this project.
167+
168+
Thank you again for your interest in stdlib, and we look forward to reviewing your future contriubtions.
169+
170+
# Lock pull request conversation:
171+
- name: 'Lock conversation'
172+
run: gh pr lock "$NUMBER" --reason spam
173+
env:
174+
GH_TOKEN: ${{ secrets.STDLIB_BOT_GITHUB_TOKEN }}
175+
GH_REPO: ${{ github.repository }}
176+
NUMBER: ${{ github.event.pull_request.number }}

0 commit comments

Comments
 (0)