GuillaumeFalourd / pull-request-action

Github Actions to create pull request (all os supported) using Github CLI ⤵️
https://github.com/marketplace/actions/pull-request-action-github-cli
Apache License 2.0
3 stars 1 forks source link

Unexpected EOF Error #15

Open RyanNutt opened 1 month ago

RyanNutt commented 1 month ago

I'm getting the following error trying to use this action, and am not quite sure where to look to see what I'm doing wrong.

/home/runner/work/_temp/7aef9f81-0b60-4bb7-ad9e-eebf62c2fca7.sh: line 167: unexpected EOF while looking for matching `"'

This is the workflow file that's running.

name: Create Feedback
on: [push]
permissions:
  pull-requests: write
jobs:
  create-feedback:
    runs-on: ubuntu-latest
    steps:
    - uses: GuillaumeFalourd/pull-request-action@v2
      with:
        source_branch: main
        destination_branch: feedback
        pr_title: Feedback
        pr_body: |-
          **Feedback**

          This feedback PR was automatically created in your repository so that we have a spot to discuss your code. **Do not merge or close this PR.**

          You can click on the **Files Changed** and **Commits** tabs to see the changes, and all of this can be seen by both you and your teacher. 
        pr_allow_empty: true
        pr_draft: false
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Thinking it might be the multiline string for pr_body I did try it with just a single line string and still had the same issue.

GuillaumeFalourd commented 1 month ago

Hi @RyanNutt , thank you for opening the issue 🚀

It might be related to the implementation using " (double quotes) in the command line argument (reference)

Using single quotes ' instead, we might resolve the problem.

Could you try using the - uses: GuillaumeFalourd/pull-request-action@eof version to check?

RyanNutt commented 1 month ago

Thanks for the quick turn around, but still seeing the same error.

  /home/runner/work/_temp/9ef106ec-fa8b-4b69-a425-458a69756e2e.sh: line 167: unexpected EOF while looking for matching `"'

What I'm trying to do is automatically open a feedback branch with the PR for student repositories so I have a place that we can discuss their code as they submit it. Something like that is built into GitHub Classroom, but it's been pretty buggy this year and I'm trying to find a way to use actions instead.

GuillaumeFalourd commented 1 month ago

It would be worth updating the action.yaml file and check how to manipulate the pr_body input to support multilines in bash.

However, I might not be able to analyze and resolve it right now, so feel free if you want to fork the repo and experiment what might be working, and then open a PR contributing to this repository with your solution 😺

RyanNutt commented 1 month ago

Same issue with a single line message in the yaml. Also tried wrapping the strings in yaml in double quotes like in your example and no change.

GuillaumeFalourd commented 1 month ago

Same issue with a single line message in the yaml. Also tried wrapping the strings in yaml in double quotes like in your example and no change.

Could you share the single line used please?

As the message is unexpected EOF while looking for matching `"', it might be related to special character in the line.

NuttKatyISD commented 1 month ago

Still me, work account. Tried with and without the quotes wrapping strings.

jobs:
  create-feedback:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: GuillaumeFalourd/pull-request-action@eof
        with:
          source_branch: "main"
          destination_branch: "feedback"
          pr_title: "Feedback"
          pr_body: "Does this work with single line?"
          pr_allow_empty: true
          pr_draft: false
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GuillaumeFalourd commented 1 month ago

Did you try using single quotes as well?

pr_body: 'Does this work with single line?'

I have some basic workflow using single lines with double quotes, one can be found here for example, and there is no issue with it.

NuttKatyISD commented 1 month ago

Same. I also took out the question mark just in case that was fouling something up in the command line that's running behind the scenes.

Does the destination branch have to exist already, or is it created as part of the action?

GuillaumeFalourd commented 1 month ago

Does the destination branch have to exist already, or is it created as part of the action?

It has to exists at the moment. But this is a feature that could eventually be added to the action as well :)