- name: Update a commentuses: sandeshjangam/comment-actions@v1id: update_commentwith:
type: "update"body: "Edit: The test comment is modified"comment_id: 856978218reactions: hooray, rocket
Delete Comment
- name: Delete a comment.uses: sandeshjangam/comment-actions@v1with:
type: "delete"comment_id: 856978218
Complex Examples
Create, Update and Append Comment
name: Create, Update and Append Commenton:
pull_request:
types: [opened,synchronize]jobs:
build:
name: Smart Comment Actionsruns-on: ubuntu-lateststeps:
- uses: actions/checkout@v2
- name: Create a commentuses: sandeshjangam/comment-actions@v1id: new_commentwith:
type: "create"body: "Test comment on PR"number: ${{ github.event.pull_request.number }}
- name: Update a commentuses: sandeshjangam/comment-actions@v1id: update_commentwith:
type: "update"body: "Edit: The test comment is modified"comment_id: ${{ steps.new_comment.outputs.comment_id }}
- name: Append to comment uses: sandeshjangam/comment-actions@v1with:
type: "append"body: "Append: Add new body at the end of the comment."comment_id: ${{ steps.new_comment.outputs.comment_id }}
Delete Comment
name: Create and Delete Commenton:
pull_request:
types: [opened,synchronize]jobs:
build:
name: Smart Comment Actionsruns-on: ubuntu-lateststeps:
- uses: actions/checkout@v2
- name: Create a comment uses: sandeshjangam/comment-actions@v1id: create_delete_commentwith:
type: "create"body: "To check the delete action"number: ${{ github.event.pull_request.number }}
- name: Find a comment using a search term.uses: sandeshjangam/comment-actions@v1id: find_commentwith:
type: "find"search_term: "To check the delete action"number: ${{ github.event.pull_request.number }}
- name: Delete a comment.uses: sandeshjangam/comment-actions@v1id: delete_commentif: ${{ steps.find_comment.outputs.comment_id != '' }}with:
type: "delete"comment_id: ${{ steps.find_comment.outputs.comment_id }}