Skip to content

Commit c2543a4

Browse files
committed
build: add autoclose workflow
1 parent 459317b commit c2543a4

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

.github/workflows/autoclose.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#/
2+
# @license Apache-2.0
3+
#
4+
# Copyright (c) 2024 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: autclose
21+
22+
# Workflow triggers:
23+
on:
24+
pull_request_target:
25+
types: [ labeled ]
26+
27+
# Workflow jobs:
28+
jobs:
29+
30+
# Define a job which closes a pull request if a contributor failed to setup EditorConfig:
31+
editorconfig:
32+
33+
# Define job name:
34+
name: 'Check for label'
35+
36+
# Only run this job if the pull request has a specific label:
37+
if: "${{ github.event.label.name == 'autoclose: EditorConfig' }}"
38+
39+
# Define job permissions:
40+
permissions:
41+
contents: read
42+
pull-requests: write
43+
44+
# Define the type of virtual host machine:
45+
runs-on: ubuntu-latest
46+
47+
# Define the sequence of job steps:
48+
steps:
49+
50+
# Close the pull request:
51+
- name: 'Close pull request'
52+
run: gh pr close "$NUMBER" --comment "$BODY"
53+
env:
54+
GH_TOKEN: ${{ secrets.STDLIB_BOT_GITHUB_TOKEN }}
55+
GH_REPO: ${{ github.repository }}
56+
NUMBER: ${{ github.event.pull_request.number }}
57+
BODY: >
58+
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). 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.
59+
60+
Thank you again for your interest in stdlib, and we look forward to reviewing your future contriubtions.

0 commit comments

Comments
 (0)