GitHub Foundations — Question 11

In the following workflow file, line 5 interprets lines 3 and 4 as Python. Which of the following is a valid option to complete line 5?
1 steps:
2 - run: |
3 import os
4 print(os.environ['PATH'])
5

Answer options

Correct answer: A

Explanation

The correct answer is A, as specifying 'shell: python' indicates that the subsequent commands should be executed in a Python environment. The other options do not correctly set the execution context for Python code; 'working-directory' relates to the path, 'shell: bash' sets a different shell, and 'with: python' is not a valid way to specify the shell.