-
-
Notifications
You must be signed in to change notification settings - Fork 3
58 lines (48 loc) · 1.35 KB
/
shell.yml
File metadata and controls
58 lines (48 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell
name: shell
on: push
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#defaultsrun
# defaults:
# run:
# shell: bash
# working-directory: scripts
jobs:
shell:
runs-on: ubuntu-latest
steps:
- name: Running a script using bash
run: echo $PATH
shell: bash
- name: Running a script using PowerShell Core
run: echo ${env:PATH}
shell: pwsh
- name: Running a Python script
run: |
import os
print(os.environ['PATH'])
shell: python
- name: Custom Perl shell
run: |
print %ENV
shell: perl {0}
- name: Custom Node.js shell
run: |
console.log(process.env);
shell: node {0}
shell-windows:
runs-on: windows-latest
steps:
- name: Running a script using Windows cmd
run: echo %PATH%
shell: cmd
- name: Running a script using PowerShell Core
run: echo ${env:PATH}
shell: pwsh
- name: Using PowerShell Desktop to run a script
run: echo ${env:PATH}
shell: powershell
- name: Running a Python script
run: |
import os
print(os.environ['PATH'])
shell: python