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

Readme for inputs not correct? #23

Closed
CWSites opened this issue May 17, 2021 · 2 comments
Closed

Readme for inputs not correct? #23

CWSites opened this issue May 17, 2021 · 2 comments

Comments

@CWSites
Copy link

CWSites commented May 17, 2021

I am passing through inputs as shown in the example and I'm getting parsing errors in my workflow that it's triggering. I've tried wrapping the inputs with a single and double quote, neither work.

workflow step

    steps:
      - name: Trigger Workflow
        uses: benc-uk/workflow-dispatch@v1
        with:
          inputs: "{ 'ref': '${{ github.ref }}', 'sha': '${{ github.sha }}' }"
          token: ${{ secrets.REPO_ACCESS_TOKEN }}
          workflow: Deploy to GitHub Pages

failure error

  with:
    inputs: { 'ref': 'refs/heads/master', 'sha': 'a6d88433859c590b163bbf77241fe1a74576b3f9' }
    token: ***
    workflow: Deploy to GitHub Pages
Error: Unexpected token ' in JSON at position 2
@CWSites
Copy link
Author

CWSites commented May 17, 2021

Update: I believe what is going on here is the workflow which is being triggered MUST specify any inputs that are being passed in. If the inputs are specified then the workflow will fail as the input is unexpected.

I updated the workflow which is being triggered with the following

on:
  workflow_dispatch:
    inputs:
      ref:
        description: 'GitHub REF to be used for checkout'
        required: true
      sha:
        description: 'GitHub SHA to be used for checkout'
        required: true

@CWSites
Copy link
Author

CWSites commented May 18, 2021

Confirmed this fixed my issue. The README.md should be updated to make this more clear.

@CWSites CWSites closed this as completed May 18, 2021
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

1 participant