Skip to content
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

Don't fail if no PR Exists (optionally?) #14

Open
WCByrne opened this issue Feb 4, 2020 · 2 comments
Open

Don't fail if no PR Exists (optionally?) #14

WCByrne opened this issue Feb 4, 2020 · 2 comments

Comments

@WCByrne
Copy link

WCByrne commented Feb 4, 2020

I have this running on all push events which works great when pushing to a branch with a PR but if there is no PR I just want it to skip. This of course happens on every PR merge where this is a push to master. In my case I still want to run the rest of my action but skip the last step which is posting a comment.

The only option I see to do this cleanly would be to use the if for the step but that would require somehow duplicating the logic this action is doing to find an associated PR.

Would it make sense to exit(0) for that case? If that would cause issues for existing users of this action, maybe it could be optional.

@Vadorequest
Copy link

I need something similar, see #16

@dlime
Copy link

dlime commented Aug 3, 2020

I've used this condition as workaround: github.event_name == 'pull_request'

      - name: comment PR
        uses: unsplash/comment-on-pr@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          msg: "Check out this message!"
        if: github.event_name == 'pull_request'

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

No branches or pull requests

3 participants