Skip to content

Commit 6dccd43

Browse files
🩹 [Patch]: Add additional Action-Test script formats in TestWorkflow.yml and update README.md with supported script formats
1 parent 29939f0 commit 6dccd43

File tree

2 files changed

+29
-12
lines changed

2 files changed

+29
-12
lines changed

‎.github/workflows/TestWorkflow.yml‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,48 +62,48 @@ jobs:
6262
# if: success() || failure()
6363
# uses: ./
6464
# with:
65-
# Debug: true
66-
# Verbose: true
6765
# Script: tests\info.ps1
6866

6967
- name: Action-Test [tests/info.ps1]
7068
if: success() || failure()
7169
uses: ./
7270
with:
73-
Debug: true
74-
Verbose: true
7571
Script: tests/info.ps1
7672

7773
- name: Action-Test [.\tests\info.ps1]
7874
if: success() || failure()
7975
uses: ./
8076
with:
81-
Debug: true
82-
Verbose: true
8377
Script: .\tests\info.ps1
8478

8579
- name: Action-Test [./tests/info.ps1]
8680
if: success() || failure()
8781
uses: ./
8882
with:
89-
Debug: true
90-
Verbose: true
9183
Script: ./tests/info.ps1
9284

85+
- name: Action-Test [. .\tests\info.ps1]
86+
if: success() || failure()
87+
uses: ./
88+
with:
89+
Script: . .\tests\info.ps1
90+
91+
- name: Action-Test [. ./tests/info.ps1]
92+
if: success() || failure()
93+
uses: ./
94+
with:
95+
Script: . ./tests/info.ps1
96+
9397
- name: Action-Test [. '.\tests\info.ps1']
9498
if: success() || failure()
9599
uses: ./
96100
with:
97-
Debug: true
98-
Verbose: true
99101
Script: . '.\tests\info.ps1'
100102

101103
- name: Action-Test [. './tests/info.ps1']
102104
if: success() || failure()
103105
uses: ./
104106
with:
105-
Debug: true
106-
Verbose: true
107107
Script: . './tests/info.ps1'
108108

109109
ActionTestCommands:

‎README.md‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,23 @@ jobs:
6969
Script: scripts/main.ps1
7070
```
7171

72+
The `Script` supports the following formats:
73+
74+
- Inline script, although it is recommended to use a script file for better tooling support and linting capabilities.
75+
- Multi-line script.
76+
- Path to a script file.
77+
- `tests/info.ps1`
78+
- `.\tests\info.ps1`
79+
- `./tests/info.ps1`
80+
- `. .\tests\info.ps1`
81+
- `. ./tests/info.ps1`
82+
83+
If you are creation an action of your own, you should use the `${{ github.action_path }}` variable to get the path to the action.
84+
You should avoid using `$env:GITHUB_ACTION_PATH` as it will not be the expected value if you nest actions inside one another.
85+
86+
> [!WARNING]
87+
> Using `tests\info.ps1` is PowerShells syntax for calling a function under a specific module.
88+
7289
#### Example 2: Run a GitHub PowerShell script without a token
7390

7491
Run a script that uses the GitHub PowerShell module.

0 commit comments

Comments
 (0)