Skip to content

Commit 72a57b0

Browse files
committed
Fix issue with more than 2 plugins listed
Signed-off-by: Jason Frey <[email protected]>
1 parent 09e84aa commit 72a57b0

File tree

4 files changed

+21
-13
lines changed

4 files changed

+21
-13
lines changed

.github/workflows/test.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,12 @@ jobs:
6565
- name: Set up ibmcloud CLI
6666
uses: ./
6767
with:
68-
plugins: container-service,secrets-manager
68+
plugins: container-service,secrets-manager,cr
6969
- name: Check plugins are installed
7070
run: |
7171
ibmcloud plugin list | grep -q '^container-service\b' &&
72-
ibmcloud plugin list | grep -q '^secrets-manager\b'
72+
ibmcloud plugin list | grep -q '^secrets-manager\b' &&
73+
ibmcloud plugin list | grep -q '^container-registry\b'
7374
7475
test-multiple-plugins-with-comma-space:
7576
runs-on: ubuntu-latest
@@ -78,11 +79,12 @@ jobs:
7879
- name: Set up ibmcloud CLI
7980
uses: ./
8081
with:
81-
plugins: container-service, secrets-manager
82+
plugins: container-service, secrets-manager, cr
8283
- name: Check plugins are installed
8384
run: |
8485
ibmcloud plugin list | grep -q '^container-service\b' &&
85-
ibmcloud plugin list | grep -q '^secrets-manager\b'
86+
ibmcloud plugin list | grep -q '^secrets-manager\b' &&
87+
ibmcloud plugin list | grep -q '^container-registry\b'
8688
8789
test-multiple-plugins-with-newlines:
8890
runs-on: ubuntu-latest
@@ -94,10 +96,12 @@ jobs:
9496
plugins: |
9597
container-service
9698
secrets-manager
99+
cr
97100
- name: Check plugins are installed
98101
run: |
99102
ibmcloud plugin list | grep -q '^container-service\b' &&
100-
ibmcloud plugin list | grep -q '^secrets-manager\b'
103+
ibmcloud plugin list | grep -q '^secrets-manager\b' &&
104+
ibmcloud plugin list | grep -q '^container-registry\b'
101105
102106
test-multiple-plugins-with-spaces:
103107
runs-on: ubuntu-latest
@@ -106,11 +110,12 @@ jobs:
106110
- name: Set up ibmcloud CLI
107111
uses: ./
108112
with:
109-
plugins: container-service secrets-manager
113+
plugins: container-service secrets-manager cr
110114
- name: Check plugins are installed
111115
run: |
112116
ibmcloud plugin list | grep -q '^container-service\b' &&
113-
ibmcloud plugin list | grep -q '^secrets-manager\b'
117+
ibmcloud plugin list | grep -q '^secrets-manager\b' &&
118+
ibmcloud plugin list | grep -q '^container-registry\b'
114119
115120
test-multiple-plugins-with-versions:
116121
runs-on: ubuntu-latest
@@ -119,11 +124,12 @@ jobs:
119124
- name: Set up ibmcloud CLI
120125
uses: ./
121126
with:
122-
plugins: [email protected], secrets-manager
127+
plugins: [email protected], secrets-manager, [email protected]
123128
- name: Check plugins are installed
124129
run: |
125130
ibmcloud plugin list | grep -q '^container-service\b.\+0\.4\.102\b' &&
126-
ibmcloud plugin list | grep -q '^secrets-manager\b'
131+
ibmcloud plugin list | grep -q '^secrets-manager\b' &&
132+
ibmcloud plugin list | grep -q '^container-registry\b.\+1\.3\.\b'
127133
128134
test-multiple-plugins-with-versions-and-newlines:
129135
runs-on: ubuntu-latest
@@ -135,10 +141,12 @@ jobs:
135141
plugins: |
136142
137143
secrets-manager
144+
138145
- name: Check plugins are installed
139146
run: |
140147
ibmcloud plugin list | grep -q '^container-service\b.\+0\.4\.102\b' &&
141-
ibmcloud plugin list | grep -q '^secrets-manager\b'
148+
ibmcloud plugin list | grep -q '^secrets-manager\b' &&
149+
ibmcloud plugin list | grep -q '^container-registry\b.\+1\.3\.\b'
142150
143151
test-login:
144152
runs-on: ubuntu-latest

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ async function captureVersion() {
5050
}
5151

5252
async function installPlugins() {
53-
const plugins = core.getInput('plugins').replace('\n', ' ').replace(',', ' ').split(' ').map(p => p.trim()).filter(p => p)
53+
const plugins = core.getInput('plugins').replace(/\n/g, ' ').replace(/,/g, ' ').split(' ').map(p => p.trim()).filter(p => p)
5454
if (plugins.length > 0) {
5555
core.startGroup('Installing IBM Cloud CLI plugins')
5656
await exec.exec('ibmcloud', ['plugin', 'install', ...plugins])

0 commit comments

Comments
 (0)