2
0
mirror of https://github.com/jmespath/jp synced 2025-08-22 09:37:10 +00:00

Add additional maintenance github workflows

Workflow to help with mainenance of this repo including
auto-comment and stale issue/PR management.
This commit is contained in:
James Saryerwinnie 2023-03-31 00:35:46 -04:00
parent bc914315f0
commit 7773ce16a9
3 changed files with 102 additions and 0 deletions

29
.github/workflows/label-comments.yaml vendored Normal file
View File

@ -0,0 +1,29 @@
name: Labels workflow
on:
pull_request:
types: [labeled]
jobs:
comments-for-labels:
runs-on: ubuntu-latest
permissions:
pull-requests: 'write'
steps:
- name: Comment on labeled pull request
if: ${{ github.event.label.name == 'needs-tests' }}
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { owner, repo } = context.repo;
const { number, labels } = context.payload.pull_request;
const message = 'Thanks for the pull request! ' +
'Before we can merge this, we require tests to be added. ' +
'This helps us maintain the quality of the codebase and ' +
'ensures we don\'t regress on this change in the future. ' +
'See our contributing guidelines for ' +
'more details. Let us know if you have any questions, and ' +
'thanks again for the pull request!';
await github.rest.issues.createComment({
owner, repo, issue_number: number, body: message});

32
.github/workflows/stale.yml vendored Normal file
View File

@ -0,0 +1,32 @@
# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
#
# You can adjust the behavior by modifying this file.
# For more information, see:
# https://github.com/actions/stale
name: Mark stale issues and pull requests
on:
schedule:
- cron: '32 9 * * *'
jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is still waiting on a response, and will be closed soon if there is no response.'
stale-pr-message: 'This PR is still waiting on updates and will be closed soon if there is no update.'
stale-issue-label: 'closing-soon-if-no-response'
stale-pr-label: 'closing-soon-if-no-response'
days-before-stale: 7
days-before-close: 2
days-before-pr-stale: 30
days-before-pr-close: 7
any-of-labels: response-needed,changes-requested

41
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,41 @@
# Contributing
We work hard to provide a high-quality and useful CLI, and we greatly value
feedback and contributions from our community. Whether it's a new feature,
correction, or additional documentation, we welcome your pull requests. Please
submit any [issues](https://github.com/jmespath/jp/issues)
or [pull requests](https://github.com/jmespath/jp/pulls)
through GitHub.
This document contains guidelines for contributing code and filing issues.
## Contributing Code
This list below are guidelines to use when submitting pull requests.
These are the same set of guidelines that the core contributors use
when submitting changes, and we ask the same of all community
contributions as well:
* We maintain a high percentage of code coverage in our tests. As a general
rule of thumb, code changes should not lower the overall code coverage
percentage for the project. In practice, this means that every bug fix and
feature addition should include tests.
* All PRs must run cleanly through `make test`.
in more detail in the sections below.
## Feature Development
This CLI is designed to be a reference CLI implementation of JMESPath,
and implements the official JMESPath specification. As such, we do not
accept feature requests that are not part of the official JMESPath
specification. If you would like to propose changes to the JMESPath
language itself, which includes new syntax, functions, operators, etc.,
you can create a JMESPath enhancement proposal in the
[jmespath.jep repository](https://github.com/jmespath/jmespath.jep).
Once the proposal is accepted, we can then implement the changes in this
CLI.
## Running Tests
To run the tests, you can run `make test`.