Skip to content

Commit

Permalink
Merge pull request #37 from k1LoW/support-scopes
Browse files Browse the repository at this point in the history
Support `read:parent` scope
  • Loading branch information
k2tzumi authored Dec 3, 2024
2 parents 681e35d + 37d6650 commit 961db8a
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
- name: 'Option test'
uses: ./
with:
version: "v0.122.1"
command: run
path_pattern: testdata/path/to/*.yml
debug: true
Expand All @@ -33,6 +34,8 @@ jobs:
shuffle: true
concurrent: true
enable-run-exec-scope: true
enable-read-remote-scope: true
enable-read-parent-scope: true
labels: "integration,integration_http"
env:
# Override parameters in scenario with environment variables
Expand Down
10 changes: 7 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ inputs:
description: Concurrent mode
required: false
default: false
enable-read-parent-scope:
description: Required for reading parent files.(`--scopes read:parent`)
required: false
default: false
enable-read-remote-scope:
description: Required for reading remote files.(`--scopes read:remote`)
required: false
Expand Down Expand Up @@ -109,7 +113,7 @@ runs:
${{ (inputs.skip-test == 'true' && '--skip-test') || '' }} \
${{ (inputs.shuffle == 'true' && '--shuffle on') || '' }} \
${{ (inputs.concurrent == 'true' && '--concurrent on') || '' }} \
${{ (inputs.enable-read-remote-scope == 'true' && inputs.enable-run-exec-scope == 'true' && '--scopes read:remote,run:exec') || '' }} \
${{ (inputs.enable-read-remote-scope == 'true' && inputs.enable-run-exec-scope == 'false' && '--scopes read:remote') || '' }} \
${{ (inputs.enable-read-remote-scope == 'false' && inputs.enable-run-exec-scope == 'true' && '--scopes run:exec') || '' }} \
${{ (inputs.enable-read-parent-scope == 'true' && '--scopes read:parent') || '' }} \
${{ (inputs.enable-read-remote-scope == 'true' && '--scopes read:remote') || '' }} \
${{ (inputs.enable-run-exec-scope == 'true' && '--scopes run:exec') || '' }} \
$LABEL_OPTIONS
7 changes: 7 additions & 0 deletions testdata/path/hello.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
desc: Parent runbook
labels:
- integration
steps:
-
test: |
len('hello') == 5
7 changes: 7 additions & 0 deletions testdata/path/to/parent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
desc: Parent include sample
labels:
- integration
steps:
-
include:
path: ../hello.yml
1 change: 0 additions & 1 deletion testdata/path/to/remote.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
desc: Remote include sample
labels:
- integration
if: false
steps:
-
include:
Expand Down

0 comments on commit 961db8a

Please sign in to comment.