mirror of
https://github.com/marocchino/sticky-pull-request-comment.git
synced 2025-12-14 20:41:15 +00:00
Fix unexpected delete fail
This commit is contained in:
parent
17dbcbf6a4
commit
acc9cee2ce
3 changed files with 3 additions and 3 deletions
|
|
@ -111,7 +111,7 @@ with:
|
||||||
Release ${{ github.sha }} to <https://pr-${{ github.event.number }}.example.com>
|
Release ${{ github.sha }} to <https://pr-${{ github.event.number }}.example.com>
|
||||||
```
|
```
|
||||||
|
|
||||||
### Delete previous commit
|
### Delete previous comment
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
uses: marocchino/sticky-pull-request-comment@v2
|
uses: marocchino/sticky-pull-request-comment@v2
|
||||||
|
|
|
||||||
2
lib/main.js
generated
2
lib/main.js
generated
|
|
@ -52,7 +52,7 @@ function run() {
|
||||||
const githubToken = core.getInput("GITHUB_TOKEN", { required: true });
|
const githubToken = core.getInput("GITHUB_TOKEN", { required: true });
|
||||||
const octokit = github.getOctokit(githubToken);
|
const octokit = github.getOctokit(githubToken);
|
||||||
const previous = yield comment_1.findPreviousComment(octokit, repo, number, header);
|
const previous = yield comment_1.findPreviousComment(octokit, repo, number, header);
|
||||||
if (!message && !path) {
|
if (!deleteOldComment && !message && !path) {
|
||||||
throw { message: 'Either message or path input is required' };
|
throw { message: 'Either message or path input is required' };
|
||||||
}
|
}
|
||||||
if (deleteOldComment && recreate) {
|
if (deleteOldComment && recreate) {
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ async function run() {
|
||||||
const octokit = github.getOctokit(githubToken);
|
const octokit = github.getOctokit(githubToken);
|
||||||
const previous = await findPreviousComment(octokit, repo, number, header);
|
const previous = await findPreviousComment(octokit, repo, number, header);
|
||||||
|
|
||||||
if (!message && !path) {
|
if (!deleteOldComment && !message && !path) {
|
||||||
throw { message: 'Either message or path input is required' };
|
throw { message: 'Either message or path input is required' };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue