Skip to content

Commit a502cf8

Browse files
mhjacksMartin Jackson
andauthored
Update tox action to understand parameters if used in PR flow (#154)
* Update tox action to understand parameters if used in PR flow * Allow passing checkout reference and fetch depth if needed --------- Co-authored-by: Martin Jackson <[email protected]>
1 parent f6ba706 commit a502cf8

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

.github/workflows/tox.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,31 @@ on:
1212
required: false
1313
type: string
1414
default: ""
15+
checkout_ref:
16+
description: Repository reference to pass to checkout action
17+
required: false
18+
type: string
19+
default: ""
20+
checkout_fetch_depth:
21+
description: Fetch depth to pass to checkout action
22+
required: false
23+
type: string
24+
default: "0"
1525
jobs:
1626
tox:
1727
runs-on: ubuntu-latest
1828
name: Run Tox based code tests
1929
steps:
2030
- name: Code checkout
31+
if: ${{ ! inputs.checkout_ref }}
32+
uses: actions/checkout@v3
33+
34+
- name: Code checkout with parameters
35+
if: ${{ inputs.checkout_ref }}
2136
uses: actions/checkout@v3
37+
with:
38+
ref: ${{ inputs.checkout_ref }}
39+
fetch-depth: ${{ inputs.checkout_fetch_depth }}
2240

2341
- name: Run tests
2442
uses: ansible-network/github_actions/.github/actions/tox@main

0 commit comments

Comments
 (0)