@@ -9,11 +9,20 @@ inputs:
9
9
description : " Path to the collection source"
10
10
required : true
11
11
collection_path :
12
- description : The final collection path
13
- required : true
12
+ description : |
13
+ The final collection path
14
+ If not set, this will be determined by the action
15
+ default : " "
14
16
tar_file :
15
- description : The collection tarball when built
16
- required : true
17
+ description : |
18
+ The collection tarball when built
19
+ If not set, this will be determined by the action
20
+ default : " "
21
+
22
+ outputs :
23
+ collection_path :
24
+ description : The final collection path
25
+ value : ${{ inputs.collection_path || steps.identify.outputs.collection_path }}
17
26
18
27
runs :
19
28
using : composite
@@ -57,17 +66,24 @@ runs:
57
66
shell : bash
58
67
working-directory : ${{ inputs.source_path }}
59
68
69
+ - name : identify collection (final installation path and tarball name)
70
+ id : identify
71
+ uses : ansible-network/github_actions/.github/actions/identify_collection@main
72
+ with :
73
+ source_path : ${{ inputs.source_path }}
74
+ if : ${{ (inputs.collection_path == '') || (inputs.tar_file == '') }}
75
+
60
76
- name : Build collection
61
77
run : ansible-galaxy collection build -vvv
62
78
shell : bash
63
79
working-directory : ${{ inputs.source_path }}
64
80
65
81
- name : Install collection and dependencies
66
- run : ansible-galaxy collection install ./${{ inputs.tar_file }} -p /home/runner/collections
82
+ run : ansible-galaxy collection install ./${{ steps.identify.outputs.tar_file || inputs.tar_file }} -p /home/runner/collections
67
83
shell : bash
68
84
working-directory : ${{ inputs.source_path }}
69
85
70
86
- name : Copy the galaxy.yml from source to destination, needed for pytest-ansible-units
71
- run : cp galaxy.yml ${{ inputs.collection_path }}/galaxy.yml
87
+ run : cp galaxy.yml ${{ steps.identify.outputs.collection_path || inputs.collection_path }}/galaxy.yml
72
88
shell : bash
73
89
working-directory : ${{ inputs.source_path }}
0 commit comments