Skip to content

Commit 9fd9b64

Browse files
committed
Replace jq with Actions expression for proxy_urls validation
For the sake of consistency with the other pre-existing validation code.
1 parent 0c7c298 commit 9fd9b64

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

pr-checks/checks/start-proxy.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,8 @@ steps:
3939
run: exit 1
4040

4141
- name: Validate proxy_urls contains expected registries
42-
env:
43-
PROXY_URLS: ${{ steps.proxy.outputs.proxy_urls }}
44-
run: |
45-
jq --null-input --exit-status '
46-
env.PROXY_URLS
47-
| fromjson
48-
| length == 2 and
49-
any(.[]; .type=="maven-repository" and .url=="https://acme.jfrog.io/artifactory/my-maven-registry") and
50-
any(.[]; .type=="maven-repository" and .url=="https://repo1.maven.org/maven2")
51-
'
42+
if: |
43+
join(fromJSON(steps.proxy.outputs.proxy_urls)[*].type, ',') != 'maven-repository,maven-repository'
44+
|| !contains(fromJSON(steps.proxy.outputs.proxy_urls)[*].url, 'https://acme.jfrog.io/artifactory/my-maven-registry')
45+
|| !contains(fromJSON(steps.proxy.outputs.proxy_urls)[*].url, 'https://repo1.maven.org/maven2')
46+
run: exit 1

0 commit comments

Comments
 (0)