Score:0

How to fix this yaml script of github actions?

cn flag

I am trying to learn github actions, so I purchased a course in udemy, but no response from the instructor yet.

I got stuck with the first snippet itself and getting syntax errors.

This is the action snippet I am trying, tried changing different indentations but still getting same error as syntax issue.

name: Shell commands
on: [push]
jobs:
  run-shell-command:
    runs-on: ubuntu-latest
    steps:
      - name: echo a
        string
         run: echo "hello world"
      - name: multiline
        script
          run: |
            node -v
            npm -v

Can anyone please suggest how to fix this.

Score:1
gb flag

YAML format uses indentation to denote scope and requires each entry to be on its own line. It looks like the name key in your example has an incorrect newline character, causing the second part of the name string to appear on the next line. This is incorrect formatting for YAML.

Here is the correct version:

name: Shell commands
on: [push]
jobs:
  run-shell-command:
    runs-on: ubuntu-latest
    steps:
      - name: echo a string
         run: echo "hello world"
      - name: multiline script
          run: |
            node -v
            npm -v
Score:0
us flag

try this block:

name: Shell commands
on: [push]
jobs:
  run-shell-command:
    runs-on: ubuntu-latest
    steps:
      - name: echo a
          string
         run: echo "hello world"
      - name: multiline
        script:
          run: |
            node -v
            npm -v

you may use the foloowing webiste to help you validate your yaml code.

https://codebeautify.org/yaml-validator
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.