Skip to content

Commit a38b001

Browse files
authored
Merge pull request #409 from thollander/fix/wrong-var-renaming
fix: some wrong variables renaming
2 parents cb13519 + a11fbfe commit a38b001

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ You can either pass an absolute filePath or a relative one that will be by defau
3737
- name: PR comment with file
3838
uses: thollander/actions-comment-pull-request@v3
3939
with:
40-
filePath: /path/to/file.txt
40+
file-path: /path/to/file.txt
4141
```
4242

4343

@@ -57,7 +57,7 @@ It takes only valid reactions and adds it to the comment you've just created. (S
5757

5858
### Specifying which pull request to comment on
5959

60-
You can explicitly input which pull request should be commented on by passing the `pr_number` input.
60+
You can explicitly input which pull request should be commented on by passing the `pr-number` input.
6161
That is particularly useful for manual workflow for instance (`workflow_run`).
6262

6363
```yml
@@ -67,13 +67,13 @@ That is particularly useful for manual workflow for instance (`workflow_run`).
6767
with:
6868
message: |
6969
Hello world ! :wave:
70-
pr_number: 123 # This will comment on pull request #123
70+
pr-number: 123 # This will comment on pull request #123
7171
```
7272

7373

7474
### Update a comment
7575

76-
Editing an existing comment is also possible thanks to the `comment_tag` input.
76+
Editing an existing comment is also possible thanks to the `comment-tag` input.
7777

7878
Thanks to this parameter, it will be possible to identify your comment and then to upsert on it.
7979
If the comment is not found at first, it will create a new comment.
@@ -87,28 +87,28 @@ _That is particularly interesting while committing multiple times in a PR and th
8787
with:
8888
message: |
8989
_(execution **${{ github.run_id }}** / attempt **${{ github.run_attempt }}**)_
90-
comment_tag: execution
90+
comment-tag: execution
9191
```
9292

9393
Note: the input `mode` can be used to either `upsert` (by default) or `recreate` the comment (= delete and create)
9494

9595
### Delete a comment
9696

9797

98-
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.
98+
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.
9999

100100
```yml
101101
...
102102
- name: Delete a comment
103103
uses: thollander/actions-comment-pull-request@v3
104104
with:
105-
comment_tag: to_delete
105+
comment-tag: to_delete
106106
mode: delete
107107
```
108108

109109
### Delete a comment on job completion
110110

111-
Deleting an existing comment on job completion is also possible thanks to the `comment_tag` input combined with `mode: delete-on-completion`.
111+
Deleting an existing comment on job completion is also possible thanks to the `comment-tag` input combined with `mode: delete-on-completion`.
112112

113113
This will delete the comment at the end of the job.
114114

@@ -119,7 +119,7 @@ This will delete the comment at the end of the job.
119119
with:
120120
message: |
121121
The PR is being built...
122-
comment_tag: to_delete_on_completion
122+
comment-tag: to_delete_on_completion
123123
mode: delete-on-completion
124124
```
125125

lib/cleanup/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9549,7 +9549,7 @@ async function run() {
95499549
return;
95509550
}
95519551
if (!commentTag) {
9552-
core.debug("No 'comment_tag' parameter passed in. Cannot search for something to delete.");
9552+
core.debug("No 'comment-tag' parameter passed in. Cannot search for something to delete.");
95539553
return;
95549554
}
95559555
const context = github.context;

lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9555,7 +9555,7 @@ async function run() {
95559555
const mode = core.getInput('mode');
95569556
const createIfNotExists = core.getInput('create-if-not-exists') === 'true';
95579557
if (!message && !filePath && mode !== 'delete') {
9558-
core.setFailed('Either "filePath" or "message" should be provided as input unless running as "delete".');
9558+
core.setFailed('Either "file-path" or "message" should be provided as input unless running as "delete".');
95599559
return;
95609560
}
95619561
let content = message;
@@ -9672,7 +9672,7 @@ async function run() {
96729672
core.info('No comment has been found with asked pattern. Creating a new comment.');
96739673
}
96749674
else {
9675-
core.info('Not creating comment as the pattern has not been found. Use `create_if_not_exists: true` to create a new comment anyway.');
9675+
core.info('Not creating comment as the pattern has not been found. Use `create-if-not-exists: true` to create a new comment anyway.');
96769676
return;
96779677
}
96789678
}

src/cleanup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ async function run() {
1414
}
1515

1616
if (!commentTag) {
17-
core.debug("No 'comment_tag' parameter passed in. Cannot search for something to delete.");
17+
core.debug("No 'comment-tag' parameter passed in. Cannot search for something to delete.");
1818
return;
1919
}
2020

src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ async function run() {
1919
const createIfNotExists: boolean = core.getInput('create-if-not-exists') === 'true';
2020

2121
if (!message && !filePath && mode !== 'delete') {
22-
core.setFailed('Either "filePath" or "message" should be provided as input unless running as "delete".');
22+
core.setFailed('Either "file-path" or "message" should be provided as input unless running as "delete".');
2323
return;
2424
}
2525

@@ -176,7 +176,7 @@ async function run() {
176176
core.info('No comment has been found with asked pattern. Creating a new comment.');
177177
} else {
178178
core.info(
179-
'Not creating comment as the pattern has not been found. Use `create_if_not_exists: true` to create a new comment anyway.',
179+
'Not creating comment as the pattern has not been found. Use `create-if-not-exists: true` to create a new comment anyway.',
180180
);
181181
return;
182182
}

0 commit comments

Comments
 (0)