Fix: Skip action correctly on non-PR events to prevent ci errors #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First, I want to say that I've been using this action in my projects and it's incredibly useful! Thank you for creating such a convenient tool for Cloudflare Pages deployments - it has significantly improved our workflow.
Problem
Currently, when this action runs on non-PR events (like push events), it attempts to skip execution by using exit 0 in the first step. However, in Composite Actions, this doesn't prevent subsequent steps from running. As a result, when the PR comment step runs on a non-PR event, it fails with the error
Error: No issue/pull request in input neither in current context.
You can see the error in the screenshot below:

For further reference, you can see the full workflow run at this URL:
https://github.com/okm321/okmkm-blog/actions/runs/14019088314/job/39248580191
Solution
This PR fixes the issue by:
Changes
Testing
I've tested this fix by implementing the modified Composite Action in my own repository. I verified that:
This confirms that the fix works as expected in real-world usage scenarios while maintaining all existing functionality.
You can see the working examples here:
PR event: https://github.com/okm321/okmkm-blog/actions/runs/14019349029/job/39249162308?pr=3
Push event: https://github.com/okm321/okmkm-blog/actions/runs/14019368610/job/39249208970