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

Workflow displaying error: yaml: line 11: did not find expected key #8

Open
qJake opened this issue Aug 28, 2019 · 4 comments · May be fixed by #296
Open

Workflow displaying error: yaml: line 11: did not find expected key #8

qJake opened this issue Aug 28, 2019 · 4 comments · May be fixed by #296
Assignees

Comments

@qJake
Copy link

qJake commented Aug 28, 2019

I committed a greeting action via the main Actions homepage (one of the templates) and customized the messages.

name: Greetings

on: [pull_request, issues]

jobs:
  greeting:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/first-interaction@v1
      with:
        repo-token: ${{ secrets.GITHUB_TOKEN }}
        issue-message: 'Hey, thanks for opening your first issue! 🙂 Be sure to check out the contribution guidelines if you haven't already. Thanks!'
        pr-message: 'Hey, congratulations on your first pull request for HACC! 🎉'

On the Actions tab for a commit, a few things are off:

  • The "runs on" field says "push", but should say "pull_request, issues"
  • It says the file is invalid, but this is an OOTB example

image

What am I doing wrong, or is this a bug with Actions since it's still in beta?

@damccorm
Copy link
Contributor

damccorm commented Sep 3, 2019

This works if you use double quotes instead of single quotes:

name: Greetings

on: [pull_request, issues]

jobs:
  greeting:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/first-interaction@v1
      with:
        repo-token: ${{ secrets.GITHUB_TOKEN }}
        issue-message: "Hey, thanks for opening your first issue! 🙂 Be sure to check out the contribution guidelines if you haven't already. Thanks!"
        pr-message: "Hey, congratulations on your first pull request for HACC! 🎉"

@jclem do you know why this is getting a validation error (or who this should get routed to)?

@skoblenick
Copy link

This issue is likely due to unescaped single quotes in the issue-message and pr-mesage in the provided example on the README or the issue-message above. This is why the double quotes works. The above haven't would need to be escaped.

From the README example, all instances of users' would need to escaped:

    issue-message: '# Message with markdown.\nThis is the message that will be displayed on users' first issue.'
    pr-message: 'Message that will be displayed on users' first pr. Look, a `code block` for markdown.'

Note to escape single quotes you would actually do (double single quotes):

    issue-message: '# Message with markdown.\nThis is the message that will be displayed on users'' first issue.'

@thomasbnt
Copy link

Thanks for your help! 👍

@ncalteen
Copy link
Collaborator

This should be resolved by #296 :)

@ncalteen ncalteen self-assigned this Feb 22, 2024
@ncalteen ncalteen linked a pull request Feb 22, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

6 participants
@qJake @skoblenick @ncalteen @thomasbnt @damccorm and others