Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions actions/setup/js/add_reaction.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,10 @@ async function main() {

// Check if the error is due to a locked issue/PR/discussion
// GitHub API returns 403 with specific messages for locked resources
const is403Error = error && typeof error === "object" && "status" in error && error.status === 403;
const hasLockedMessage = errorMessage && (errorMessage.includes("locked") || errorMessage.includes("Lock conversation"));

// Only ignore the error if it's a 403 AND mentions locked, or if the message mentions locked
if ((is403Error && hasLockedMessage) || (!is403Error && hasLockedMessage)) {
// Silently ignore locked resource errors - just log for debugging
// Silently ignore locked resource errors regardless of status code
if (hasLockedMessage) {
core.info(`Cannot add reaction: resource is locked (this is expected and not an error)`);
return;
}
Expand Down
6 changes: 2 additions & 4 deletions actions/setup/js/add_reaction_and_edit_comment.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,10 @@ async function main() {

// Check if the error is due to a locked issue/PR/discussion
// GitHub API returns 403 with specific messages for locked resources
const is403Error = error && typeof error === "object" && "status" in error && error.status === 403;
const hasLockedMessage = errorMessage && (errorMessage.includes("locked") || errorMessage.includes("Lock conversation"));

// Only ignore the error if it's a 403 AND mentions locked, or if the message mentions locked
if ((is403Error && hasLockedMessage) || (!is403Error && hasLockedMessage)) {
// Silently ignore locked resource errors - just log for debugging
// Silently ignore locked resource errors regardless of status code
if (hasLockedMessage) {
core.info(`Cannot add reaction: resource is locked (this is expected and not an error)`);
return;
}
Expand Down