Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/libra-foundation/pull-request-comments
Comment file or message on pull requests.
https://github.com/libra-foundation/pull-request-comments
actions pullrequest python3
Last synced: 23 days ago
JSON representation
Comment file or message on pull requests.
- Host: GitHub
- URL: https://github.com/libra-foundation/pull-request-comments
- Owner: Libra-foundation
- License: mit
- Created: 2022-12-07T07:42:08.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-10T17:00:27.000Z (about 2 years ago)
- Last Synced: 2024-12-21T16:03:00.559Z (26 days ago)
- Topics: actions, pullrequest, python3
- Language: Python
- Homepage: https://github.com/marketplace/actions/pull-request-comments
- Size: 21.5 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Pull Request Comment
A GitHub action which adds comments on PRs based on templates.
## Usage Example
[`.github/workflows/example.yml`](.github/workflows/example.yml)
```yml
name: Example
on:
pull_request:
branches: [ "main" ]jobs:
comment:
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Add a comment to the PR
uses: Libra-foundation/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: templates/template.md
```The workflow above will comment the content of the template. As of now the workflow does not format template. Depending
on the configuration of your repositories you might not need to explicitly set the permissions.```yml
name: Example
on:
pull_request:
branches: [ "main" ]jobs:
comment:
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3- name: Add a comment to the PR
uses: Correlatio-company/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: templates/template.md
tag: template- name: create a new template
run: echo "This is a generated text" > templates/temp.md- name: Try to add another comment to the PR
uses: Libra-foundation/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: templates/temp.md
tag: template
```The workflow above will comment the content of the template `template.md` then, create a new file and will try to
comment it. As we are using the same tag for both comment, the second won't be added unless we specify `override: true`
as another parameter. If `override` is set top true, the action will edit the previous comment and change its content.
This is handy if you want to comment coverage on PR but do not want the PR to be spammed with comments or to have the
coverage not up to date. The `tag` and `override` arguments are both optional and if omitted the behavior of the action
will be the same as in the 1.0.## Contributing
see [CONTRIBUTING.md](CONTRIBUTING.md)