Skip to content

fix: use core.setFailed() instead of throw Error() in find-exercise-issue workflow#117

Merged
FidelusAleksander merged 2 commits intomainfrom
claude/update-find-exercise-error-handling
Mar 4, 2026
Merged

fix: use core.setFailed() instead of throw Error() in find-exercise-issue workflow#117
FidelusAleksander merged 2 commits intomainfrom
claude/update-find-exercise-error-handling

Conversation

@Claude
Copy link
Copy Markdown
Contributor

@Claude Claude AI commented Mar 3, 2026

Changes

The find-exercise-issue workflow was throwing unhandled errors when no exercise issue was found, resulting in GitHub Actions displaying "Error: Unhandled error: Error: No exercise issue found."

Changed error handling in .github/workflows/find-exercise-issue.yml to use core.setFailed() instead of throw new Error():

// Before
if (!issue) {
  throw new Error('No exercise issue found');
}

// After
if (!issue) {
  core.setFailed('No exercise issue found');
  return;
}

This matches the pattern used elsewhere in the codebase (e.g., actions/file-exists/action.yml) and ensures proper error formatting in GitHub Actions.

Checklist

  • I have added or updated appropriate labels to this PR
  • I have tested my changes
  • I have updated the documentation if needed

…ssue workflow

Co-authored-by: FidelusAleksander <63016446+FidelusAleksander@users.noreply.github.com>
@Claude Claude AI changed the title [WIP] Update find-exercise job to handle errors properly fix: use core.setFailed() instead of throw Error() in find-exercise-issue workflow Mar 3, 2026
@FidelusAleksander FidelusAleksander marked this pull request as ready for review March 3, 2026 19:04
Copilot AI review requested due to automatic review settings March 3, 2026 19:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the find-exercise-issue workflow’s error handling to fail the GitHub Actions step cleanly (without an “Unhandled error”) when no matching exercise issue is found.

Changes:

  • Replaced throw new Error(...) with core.setFailed(...) for missing-issue handling
  • Added an early return after setting the failure state to stop further script execution

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions github-actions bot added the workflows Changes to reusable workflows label Mar 4, 2026
@FidelusAleksander FidelusAleksander merged commit 2795fc3 into main Mar 4, 2026
8 of 10 checks passed
@FidelusAleksander FidelusAleksander deleted the claude/update-find-exercise-error-handling branch March 4, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

workflows Changes to reusable workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants