From a11fbfe707d47a1bcbee412b88496301f7837330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=A9rence=20Hollander?= Date: Sat, 2 Nov 2024 07:20:35 +0100 Subject: [PATCH] fix: some wrong variables renaming --- README.md | 18 +++++++++--------- lib/cleanup/index.js | 2 +- lib/index.js | 4 ++-- src/cleanup.ts | 2 +- src/main.ts | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index e1e2b0f..2d6649b 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ You can either pass an absolute filePath or a relative one that will be by defau - name: PR comment with file uses: thollander/actions-comment-pull-request@v3 with: - filePath: /path/to/file.txt + file-path: /path/to/file.txt ``` @@ -57,7 +57,7 @@ It takes only valid reactions and adds it to the comment you've just created. (S ### Specifying which pull request to comment on -You can explicitly input which pull request should be commented on by passing the `pr_number` input. +You can explicitly input which pull request should be commented on by passing the `pr-number` input. That is particularly useful for manual workflow for instance (`workflow_run`). ```yml @@ -67,13 +67,13 @@ That is particularly useful for manual workflow for instance (`workflow_run`). with: message: | Hello world ! :wave: - pr_number: 123 # This will comment on pull request #123 + pr-number: 123 # This will comment on pull request #123 ``` ### Update a comment -Editing an existing comment is also possible thanks to the `comment_tag` input. +Editing an existing comment is also possible thanks to the `comment-tag` input. Thanks to this parameter, it will be possible to identify your comment and then to upsert on it. If the comment is not found at first, it will create a new comment. @@ -87,7 +87,7 @@ _That is particularly interesting while committing multiple times in a PR and th with: message: | _(execution **${{ github.run_id }}** / attempt **${{ github.run_attempt }}**)_ - comment_tag: execution + comment-tag: execution ``` Note: the input `mode` can be used to either `upsert` (by default) or `recreate` the comment (= delete and create) @@ -95,20 +95,20 @@ Note: the input `mode` can be used to either `upsert` (by default) or `recreate` ### Delete a comment -Deleting a comment with a specific `comment_tag` is possible with the `mode: delete`. If a comment with the `comment_tag` exists, it will be deleted when ran. +Deleting a comment with a specific `comment-tag` is possible with the `mode: delete`. If a comment with the `comment-tag` exists, it will be deleted when ran. ```yml ... - name: Delete a comment uses: thollander/actions-comment-pull-request@v3 with: - comment_tag: to_delete + comment-tag: to_delete mode: delete ``` ### Delete a comment on job completion -Deleting an existing comment on job completion is also possible thanks to the `comment_tag` input combined with `mode: delete-on-completion`. +Deleting an existing comment on job completion is also possible thanks to the `comment-tag` input combined with `mode: delete-on-completion`. This will delete the comment at the end of the job. @@ -119,7 +119,7 @@ This will delete the comment at the end of the job. with: message: | The PR is being built... - comment_tag: to_delete_on_completion + comment-tag: to_delete_on_completion mode: delete-on-completion ``` diff --git a/lib/cleanup/index.js b/lib/cleanup/index.js index 59d7788..e370fbf 100644 --- a/lib/cleanup/index.js +++ b/lib/cleanup/index.js @@ -9549,7 +9549,7 @@ async function run() { return; } if (!commentTag) { - core.debug("No 'comment_tag' parameter passed in. Cannot search for something to delete."); + core.debug("No 'comment-tag' parameter passed in. Cannot search for something to delete."); return; } const context = github.context; diff --git a/lib/index.js b/lib/index.js index 8fc7efa..1122a42 100644 --- a/lib/index.js +++ b/lib/index.js @@ -9555,7 +9555,7 @@ async function run() { const mode = core.getInput('mode'); const createIfNotExists = core.getInput('create-if-not-exists') === 'true'; if (!message && !filePath && mode !== 'delete') { - core.setFailed('Either "filePath" or "message" should be provided as input unless running as "delete".'); + core.setFailed('Either "file-path" or "message" should be provided as input unless running as "delete".'); return; } let content = message; @@ -9672,7 +9672,7 @@ async function run() { core.info('No comment has been found with asked pattern. Creating a new comment.'); } else { - core.info('Not creating comment as the pattern has not been found. Use `create_if_not_exists: true` to create a new comment anyway.'); + core.info('Not creating comment as the pattern has not been found. Use `create-if-not-exists: true` to create a new comment anyway.'); return; } } diff --git a/src/cleanup.ts b/src/cleanup.ts index bd54aaf..c7592bb 100644 --- a/src/cleanup.ts +++ b/src/cleanup.ts @@ -14,7 +14,7 @@ async function run() { } if (!commentTag) { - core.debug("No 'comment_tag' parameter passed in. Cannot search for something to delete."); + core.debug("No 'comment-tag' parameter passed in. Cannot search for something to delete."); return; } diff --git a/src/main.ts b/src/main.ts index 6afd917..86eae9e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -19,7 +19,7 @@ async function run() { const createIfNotExists: boolean = core.getInput('create-if-not-exists') === 'true'; if (!message && !filePath && mode !== 'delete') { - core.setFailed('Either "filePath" or "message" should be provided as input unless running as "delete".'); + core.setFailed('Either "file-path" or "message" should be provided as input unless running as "delete".'); return; } @@ -176,7 +176,7 @@ async function run() { core.info('No comment has been found with asked pattern. Creating a new comment.'); } else { core.info( - 'Not creating comment as the pattern has not been found. Use `create_if_not_exists: true` to create a new comment anyway.', + 'Not creating comment as the pattern has not been found. Use `create-if-not-exists: true` to create a new comment anyway.', ); return; }