pull-request-comment-branch icon indicating copy to clipboard operation
pull-request-comment-branch copied to clipboard

conditionally fail action

Open jetersen opened this issue 5 years ago • 2 comments

would be nice to avoid failing the action.

I have workflow that deploys artifacts on pull request comment and on master branch pushes.

on:
  push:
    branches:
      - 'master'
  issue_comment:
    types:
      - created

jetersen avatar Dec 29 '20 21:12 jetersen

The action does not fail gracefully when run on none PR comment:

Error: Variable $number of type Int! was provided invalid value
(node:1812) UnhandledPromiseRejectionWarning: GraphqlError: Variable $number of type Int! was provided invalid value
    at /home/runner/work/_actions/xt0rted/pull-request-comment-branch/v1/webpack:/pull-request-comment-branch/node_modules/@octokit/graphql/dist-node/index.js:56:1
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:1812) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1812) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:1812) UnhandledPromiseRejectionWarning: HttpError: Not Found
    at /home/runner/work/_actions/xt0rted/pull-request-comment-branch/v1/webpack:/pull-request-comment-branch/node_modules/@octokit/request/dist-node/index.js:66:1
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:1812) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)

jetersen avatar Dec 29 '20 21:12 jetersen

you can slap a if: ${{ github.event.issue.pull_request }} on there

hhanesand avatar Mar 28 '21 17:03 hhanesand