Skip to content

Commit

Permalink
Automate response to PRs trying to update commands (#969)
Browse files Browse the repository at this point in the history
* Automate response to PRs trying to update commands

We frequently see PRs that try to fix or improve command docs. As the
pages are autogenerated this is a futile endeavour.

We regularly have to respond to them and close the PR.

Attempt to provide a workflow that will react to PRs that affect the
command docs path and send a comment.
I don't autoclose for now, as the autogenerated still come in as a PR.

* Try to tweak body for correct markdown

* Resort to basic js
  • Loading branch information
sholderbach committed Jul 1, 2023
1 parent 8b0facd commit b55a3b6
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/command-block.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Comment on manual command changes
on:
pull_request:
paths:
- 'commands/docs/**'

jobs:
comment:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Awesome that you are trying to improve the documentation of a nushell command!\n\n' +
'As we autogenerate these command pages from the help information defined with the command after each release:\n'+
'- If you already updated the command help, you are already done!\n'+
'- Else, please look for the command in the [source tree](https://github.com/nushell/nushell/tree/main/crates) and make your changes directly there.\n\n'+
'Thanks for helping out!'
})

0 comments on commit b55a3b6

Please sign in to comment.