How to remove this error. I am at sea to understand this. please suggest a solution

This is a basic workflow to help you get started with Actions

name: Bootcamp Practice

Controls when the action will run.

on:

Triggers the workflow on push or pull request events but only for the main branch

push:
branches: [ main ]

Allows you to run this workflow manually from the Actions tab

workflow_dispatch:

A workflow run is made up of one or more jobs that can run sequentially or in parallel

jobs:

This workflow contains a single job called “build”

build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
  # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
  - uses: actions/checkout@v2

  # Runs a single command using the runners shell
  - name: Installing Node
    run: actions/setup-node@v2-beta
   
    with:

Check failure on line 30 in .github/workflows/hassan.yml

GitHub Actions
/ Bootcamp Practice
Invalid workflow file
The workflow is not valid. .github/workflows/hassan.yml (Line: 30, Col: 9): Unexpected value ‘with’
node-version: 12

  # Runs a set of commands using the runners shell
  - name: Installing surge
    run: npm install --g surge
 
  - name: Deploying using surge
    run: surge ./juicy-chair.surge.sh --token $ {{secret.My_Token}}
1 Like

The immediate problem is that you can’t use with for arguments with a run step. with is only applicable to uses steps, which call pre-made actions. A run step runs a script or command.

It looks like you’re actually trying to us a pre-made action there, specifically setup-node. So you need to use

    uses: actions/setup-node@v2-beta

in that step, not run like you currently do.

Finally, please do not post multiple topics for the same question. It’s annoying and violates the Code of Conduct for this forum.

1 Like

i will act upon your advice.