@@ -22,8 +22,8 @@ inputs:
22
22
description : ' Path to a security config file to replace the default. Leave empty if security is not enabled or using the default config'
23
23
required : false
24
24
25
- opensearch_yml_file :
26
- description : ' Path to a opensearch.yml file to replace the default. Leave empty to use the default config'
25
+ port :
26
+ description : ' Port to run OpenSearch. Leave empty to use the default config (9200) '
27
27
required : false
28
28
29
29
runs :
@@ -127,9 +127,9 @@ runs:
127
127
shell : bash
128
128
129
129
- name : Replace opensearch.yml file if applicable
130
- if : ${{ inputs.opensearch_yml_file != '' }}
130
+ if : ${{ inputs.port != '' }}
131
131
run : |
132
- mv ${{ inputs.opensearch_yml_file }} ./opensearch-${{ inputs.opensearch-version }}-SNAPSHOT/config/opensearch.yml
132
+ echo -e "\nhttp.port: ${{ inputs.port }}" >> ./opensearch-${{ inputs.opensearch-version }}-SNAPSHOT/config/opensearch.yml
133
133
shell : bash
134
134
135
135
# Run OpenSearch
@@ -154,9 +154,9 @@ runs:
154
154
if : ${{ runner.os != 'Windows'}}
155
155
run : |
156
156
if [ "${{ inputs.security-enabled }}" == "true" ]; then
157
- curl https://localhost:9200/_cat/plugins -u 'admin:${{ inputs.admin-password }}' -k -v --fail-with-body
157
+ curl https://localhost:${{ inputs.port || 9200 }} /_cat/plugins -u 'admin:${{ inputs.admin-password }}' -k -v --fail-with-body
158
158
else
159
- curl http://localhost:9200/_cat/plugins -v
159
+ curl http://localhost:${{ inputs.port || 9200 }} /_cat/plugins -v
160
160
fi
161
161
shell : bash
162
162
@@ -168,10 +168,10 @@ runs:
168
168
$encodedCredentials = [Convert]::ToBase64String($credentialBytes)
169
169
$baseCredentials = "Basic $encodedCredentials"
170
170
$Headers = @{ Authorization = $baseCredentials }
171
- $url = 'https://localhost:9200/_cat/plugins'
171
+ $url = 'https://localhost:${{ inputs.port || 9200 }} /_cat/plugins'
172
172
} else {
173
173
$Headers = @{ }
174
- $url = 'http://localhost:9200/_cat/plugins'
174
+ $url = 'http://localhost:${{ inputs.port || 9200 }} /_cat/plugins'
175
175
}
176
176
Invoke-WebRequest -SkipCertificateCheck -Uri $url -Headers $Headers;
177
177
shell : pwsh
0 commit comments