first-interaction icon indicating copy to clipboard operation
first-interaction copied to clipboard

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

Open qJake opened this issue 5 years ago • 4 comments

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?

qJake avatar Aug 28 '19 02:08 qJake

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)?

damccorm avatar Sep 03 '19 19:09 damccorm

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.'

skoblenick avatar Sep 09 '19 19:09 skoblenick

Thanks for your help! :+1:

thomasbnt avatar Sep 24 '19 14:09 thomasbnt

This should be resolved by #296 :)

ncalteen avatar Feb 22 '24 21:02 ncalteen