Skip to content

Commit aab2efb

Browse files
committed
build: leave message when autoclose: Git history label is assigned
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
1 parent b947812 commit aab2efb

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/autoclose.yml

+41
Original file line numberDiff line numberDiff line change
@@ -211,3 +211,44 @@ jobs:
211211
This pull request has been automatically closed because it has been inactive for an extended period after changes were requested. If you still wish to pursue this contribution, feel free to reopen the pull request or submit a new one.
212212
213213
We appreciate your interest in contributing to stdlib!
214+
215+
# Define a job which closes a pull request if a PR has an inappropriate Git history:
216+
git_history:
217+
218+
# Define job name:
219+
name: 'Check for Git History label'
220+
221+
# Only run this job if the pull request has a specific label:
222+
if: "${{ github.event.label.name == 'autoclose: Git History' }}"
223+
224+
# Define job permissions:
225+
permissions:
226+
contents: read
227+
pull-requests: write
228+
229+
# Define the type of virtual host machine:
230+
runs-on: ubuntu-latest
231+
232+
# Define the sequence of job steps:
233+
steps:
234+
235+
# Close the pull request:
236+
- name: 'Close pull request'
237+
run: gh pr close "$NUMBER" --comment "$BODY"
238+
env:
239+
GH_TOKEN: ${{ secrets.STDLIB_BOT_PAT_REPO_WRITE }}
240+
GH_REPO: ${{ github.repository }}
241+
NUMBER: ${{ github.event.pull_request.number }}
242+
BODY: |
243+
Thank you for working on this pull request. However, we cannot accept your contribution due to Git history issues.
244+
245+
Some common issues include:
246+
247+
- Merge conflicts
248+
- Inappropriate commit messages
249+
- Unrelated commits
250+
- Including changes from merged branches that weren't intended for this PR
251+
252+
We recommend opening a new pull request with only the intended changes.
253+
254+
Thank you for your interest in stdlib, and we look forward to your future contributions.

0 commit comments

Comments
 (0)