Skip to content

Unlock on Merge - Minor Improvements #404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 22, 2025
Merged

Conversation

GrantBirki
Copy link
Member

This pull request makes it so that the "Unlock on Merge" sub-workflow of this Action does not fail when run in an unknown context and instead just logs a warning and exits.


resolves: #403

@Copilot Copilot AI review requested due to automatic review settings July 22, 2025 23:00
Copy link
Contributor

@Copilot 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

This PR improves the error handling for the "Unlock on Merge" workflow by making it more graceful when run in incorrect contexts. Instead of failing with an error, the workflow now logs warnings and exits cleanly, which is more appropriate for automated workflows that may be triggered in various contexts.

  • Replaces core.setFailed() with core.warning() for invalid workflow contexts
  • Adds specific informational logging for closed but unmerged pull requests
  • Updates tests to reflect the new warning-based approach instead of failure-based approach

Reviewed Changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/functions/unlock-on-merge.js Changes error handling from failure to warning with additional context logging
tests/functions/unlock-on-merge.test.js Updates test mocks and adds test case for closed but unmerged PR scenario

@GrantBirki GrantBirki merged commit 6c9d281 into main Jul 22, 2025
4 checks passed
@GrantBirki GrantBirki deleted the unlock-on-merge-improvements branch July 22, 2025 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

unlock on merge mode - closed PRs
1 participant