0
0
Gitdevops~10 mins

GitHub Actions basics - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the event that triggers the GitHub Action workflow.

Git
on: [1]
Drag options to blanks, or click blank then click option'
Apull
Bcommit
Cpush
Dmerge
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'commit' instead of 'push' as the event name.
Using 'merge' which is not a valid event keyword here.
2fill in blank
medium

Complete the code to define the job name in the workflow.

Git
jobs:
  build:
    [1]: ubuntu-latest
Drag options to blanks, or click blank then click option'
Aruns
Bruns-on
Cruns-on-ubuntu
Druns-on-latest
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'runs' instead of 'runs-on'.
Adding extra words like 'runs-on-ubuntu' which is invalid.
3fill in blank
hard

Fix the error in the step that runs a shell command.

Git
steps:
  - name: Run a command
    run: [1]
Drag options to blanks, or click blank then click option'
Aecho Hello World
Brun echo Hello World
Cecho 'Hello World'
Drun: echo Hello World
Attempts:
3 left
💡 Hint
Common Mistakes
Writing 'run echo Hello World' which repeats the keyword.
Using 'run: echo Hello World' inside the run value.
4fill in blank
hard

Fill both blanks to set up a step that checks out the repository code.

Git
steps:
  - name: Checkout code
    uses: [1]
    with:
      [2]: 'v3'
Drag options to blanks, or click blank then click option'
Aactions/checkout@v3
Bactions/checkout@v2
Cref
Dversion
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'actions/checkout@v2' when the latest is v3.
Using 'ref' instead of 'version' as the parameter name.
5fill in blank
hard

Fill all three blanks to create a step that sets up Node.js version 16 and runs npm install.

Git
steps:
  - uses: actions/setup-node@[1]
    with:
      node-version: '[2]'
  - name: Install dependencies
    run: [3]
Drag options to blanks, or click blank then click option'
Av3
B16
Cnpm install
Dv2
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'v3' for setup-node which may not exist.
Using 'npm install' without quotes or with extra words.