From b4cd5a059884b60c72eb7d75cef04ba07faec259 Mon Sep 17 00:00:00 2001 From: bmvermeer Date: Sun, 27 Sep 2020 01:17:04 +0200 Subject: [PATCH] fix: url for latest version was invalid. Fixed to valid url. --- .../Jenkinsfile | 2 +- .../Jenkinsfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkins/JenkinsPipeline/scripted-pipeline-java-maven-snyk-binary-full-example/Jenkinsfile b/Jenkins/JenkinsPipeline/scripted-pipeline-java-maven-snyk-binary-full-example/Jenkinsfile index 70839f6..88c6cb6 100644 --- a/Jenkins/JenkinsPipeline/scripted-pipeline-java-maven-snyk-binary-full-example/Jenkinsfile +++ b/Jenkins/JenkinsPipeline/scripted-pipeline-java-maven-snyk-binary-full-example/Jenkinsfile @@ -24,7 +24,7 @@ node { // Not required if you install the Snyk CLI on your Agent stage('Download Latest Snyk CLI') { - latest_version = sh(script: 'curl -Is "https://github.com/snyk/snyk/releases/latest" | grep "Location" | sed s#.*tag/##g', returnStdout: true) + latest_version = sh(script: 'curl -s https://api.github.com/repos/snyk/snyk/releases/latest | grep "tag_name"| cut -d : -f2', returnStdout: true).replaceAll('"','').replaceAll(',','') latest_version = latest_version.trim() echo "Latest Snyk CLI Version: ${latest_version}" diff --git a/Jenkins/JenkinsPipeline/scripted-pipeline-snyk-cli-binary-download-latest/Jenkinsfile b/Jenkins/JenkinsPipeline/scripted-pipeline-snyk-cli-binary-download-latest/Jenkinsfile index 40a63fa..63ea8a3 100644 --- a/Jenkins/JenkinsPipeline/scripted-pipeline-snyk-cli-binary-download-latest/Jenkinsfile +++ b/Jenkins/JenkinsPipeline/scripted-pipeline-snyk-cli-binary-download-latest/Jenkinsfile @@ -2,7 +2,7 @@ node { // Not required if you install the Snyk CLI on your Agent stage('Download Latest Snyk CLI') { - latest_version = sh(script: 'curl -Is "https://github.com/snyk/snyk/releases/latest" | grep "Location" | sed s#.*tag/##g', returnStdout: true) + latest_version = sh(script: 'curl -s https://api.github.com/repos/snyk/snyk/releases/latest | grep "tag_name"| cut -d : -f2', returnStdout: true).replaceAll('"','').replaceAll(',','') latest_version = latest_version.trim() echo "Latest Snyk CLI Version: ${latest_version}"