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

Problem running action: "Received event from workflow_dispatch, but received no inputs" error message #117

Open
AbianG opened this issue Feb 23, 2021 · 2 comments

Comments

@AbianG
Copy link

AbianG commented Feb 23, 2021

I'm trying to run the action as part of a test pipeline (to see if it helps with a project) but the problem is that, following the readme examples, I cannot make it run correctly. The test pipeline code is:

name: "xml-lint-TEST"

on:
  pull_request:
    branches:
      - master
      - dev
  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:
  
jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout
      uses: actions/checkout@v2

    - name: Detect changed xml files
      uses: trilom/[email protected]
      with:
        githubToken: ${{ secrets.GITHUB_TOKEN }}
        plaintext: true
    - name: Echo file changes
      run: | 
        echo Changed files: ${{ steps.get_file_changes.outputs.files }} 

Problem is, it fails with the following error:

Warning: Unexpected input(s) 'plaintext', valid inputs are ['githubRepo', 'githubToken', 'pushBefore', 'pushAfter', 'prNumber', 'output', 'fileOutput']
Run trilom/[email protected]
(node:2611) UnhandledPromiseRejectionWarning: Error: {"error":"500/inferInput Error","from":"inferInput","message":"Received event from workflow_dispatch, but received no inputs. {event_name:workflow_dispatch, pr: NaN, before:false, after:false}","payload":""}
    at run (/home/runner/work/_actions/trilom/file-changes-action/v1.2.3/dist/index.js:1:19989)
    at Object.198 (/home/runner/work/_actions/trilom/file-changes-action/v1.2.3/dist/index.js:1:20067)
    at __webpack_require__ (/home/runner/work/_actions/trilom/file-changes-action/v1.2.3/dist/index.js:1:154)
    at startup (/home/runner/work/_actions/trilom/file-changes-action/v1.2.3/dist/index.js:1:291)
    at module.exports.0 (/home/runner/work/_actions/trilom/file-changes-action/v1.2.3/dist/index.js:1:323)
    at Object.<anonymous> (/home/runner/work/_actions/trilom/file-changes-action/v1.2.3/dist/index.js:1:333)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
(node:2611) 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:2611) [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.
Error: There was an issue inferring inputs to the action.
Exception: {
  "error": "500/inferInput Error",
  "from": "inferInput",
  "message": "Received event from workflow_dispatch, but received no inputs. {event_name:workflow_dispatch, pr: NaN, before:false, after:false}",
  "payload": ""
}

I do not understand fully the error, but fearing it might have something to do with the plaintext: true statement, I removed it along with githubToken: ${{ secrets.GITHUB_TOKEN }} (all under the with: really) and reran it, still got an error about input (this time about infering input)

  with:
    githubToken: ***
    output: json
    fileOutput: json
Error: There was an issue inferring inputs to the action.
Exception: {
  "error": "500/inferInput Error",
  "from": "inferInput",
  "message": "Received event from workflow_dispatch, but received no inputs. {event_name:workflow_dispatch, pr: NaN, before:false, after:false}",
  "payload": ""
}
(node:2570) UnhandledPromiseRejectionWarning: Error: {"error":"500/inferInput Error","from":"inferInput","message":"Received event from workflow_dispatch, but received no inputs. {event_name:workflow_dispatch, pr: NaN, before:false, after:false}","payload":""}
    at run (/home/runner/work/_actions/trilom/file-changes-action/v1.2.3/dist/index.js:1:19989)
    at Object.198 (/home/runner/work/_actions/trilom/file-changes-action/v1.2.3/dist/index.js:1:20067)
    at __webpack_require__ (/home/runner/work/_actions/trilom/file-changes-action/v1.2.3/dist/index.js:1:154)
    at startup (/home/runner/work/_actions/trilom/file-changes-action/v1.2.3/dist/index.js:1:291)
    at module.exports.0 (/home/runner/work/_actions/trilom/file-changes-action/v1.2.3/dist/index.js:1:323)
    at Object.<anonymous> (/home/runner/work/_actions/trilom/file-changes-action/v1.2.3/dist/index.js:1:333)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
(node:2570) 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:2570) [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.

I am not sure of where should I start, as the pipeline is extremely simple at this point and based on the documentation. Any help will be welcome.

@rob-metalinkage
Copy link

Seems to be a bug if workflow_dispatch used to trigger this? I have same problem.

@808sAndBR
Copy link

I was able to overcome this issue by passing the PR manually using https://github.com/marketplace/actions/find-pull-request .
I think it is because workflow_dispatch is set on branches not PRs (I ended up abandoning this approach anyways since workflow dispatch could not update the PR of its test status anyways :( )

      - name: Find Pull Request
        uses: juliangruber/find-pull-request-action@v1
        id: find-pull-request
        with:
          branch: ${{github.ref_name}}

      - name: Get changed files
        id: get_file_changes
        uses: trilom/[email protected]
        with:
          output: ' '
          prNumber: ${{ steps.find-pull-request.outputs.number }}

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