|
1 | 1 | name: Comment on manual command changes
|
2 | 2 | on:
|
3 |
| - pull_request: |
| 3 | + pull_request_target: |
4 | 4 | paths:
|
5 | 5 | - 'commands/docs/**'
|
6 |
| - |
7 |
| -# Fix Resource not accessible by integration (updatePullRequest) |
8 |
| -permissions: |
9 |
| - issues: write |
10 |
| - pull-requests: write |
| 6 | + - 'commands/categories/**' |
11 | 7 |
|
12 | 8 | jobs:
|
13 | 9 | comment:
|
14 | 10 | runs-on: ubuntu-latest
|
15 |
| - # If the docs was updated by hustcer, skip the commenting step |
16 |
| - if: ${{github.event.pull_request.user.login != 'hustcer'}} |
| 11 | + # Maintainers/Contributors can add themselves exempt from this bot if they regularly run the command doc generation. |
| 12 | + # If you are on this list, be careful about accidental changes! |
| 13 | + if: ${{!contains(fromJSON('["hustcer", "sholderbach"]'), github.event.pull_request.user.login)}} |
17 | 14 | steps:
|
18 |
| - - uses: peter-evans/create-or-update-comment@v4 |
| 15 | + |
19 | 16 | with:
|
20 |
| - issue-number: ${{ github.event.pull_request.number }} |
21 |
| - body: | |
22 |
| - Awesome that you are trying to improve the documentation of a nushell command! |
23 |
| -
|
24 |
| - As we autogenerate these command pages from the help information defined with the command after each release: |
25 |
| - - If you already updated the command help, you are already done! |
26 |
| - - Else, please look for the command in the [source tree](https://github.com/nushell/nushell/tree/main/crates) and make your changes directly there. |
27 |
| -
|
28 |
| - Thanks for helping out! |
| 17 | + script: | |
| 18 | + github.rest.issues.createComment({ |
| 19 | + issue_number: context.issue.number, |
| 20 | + owner: context.repo.owner, |
| 21 | + repo: context.repo.repo, |
| 22 | + body: 'Awesome that you are trying to improve the documentation of a nushell command!\n\n' + |
| 23 | + '**You should not modify the files in `commands/docs` or `commands/categories`!**\n' + |
| 24 | + 'We autogenerate these command pages from the `help` information defined by the command implementation, after each release. Thus:\n'+ |
| 25 | + '- If you already updated the command help, you are already done and can close this PR!\n'+ |
| 26 | + '- Else, please look for the command in the [source tree](https://github.com/nushell/nushell/tree/main/crates) and make your changes directly there in the `impl Command` and `Signature`.\n'+ |
| 27 | + '- If you accidentally made a change in `commands/` while working on general documentation, please revert changes to `commands/`\n\n'+ |
| 28 | + 'Thanks for helping out!' |
| 29 | + }) |
| 30 | + - run: | |
| 31 | + echo "This PR touched autogenerated command docs. If you are not a maintainer of the autogenerated docs, please revert changes to `commands/docs/**` and make the change on the nushell side" |
| 32 | + exit 1 |
0 commit comments