Skip to content

feat: change downloadurl and add fallback on setup action#146

Merged
j-luong merged 4 commits intomasterfrom
CLI-427-update-cli-download-url
Jul 26, 2024
Merged

feat: change downloadurl and add fallback on setup action#146
j-luong merged 4 commits intomasterfrom
CLI-427-update-cli-download-url

Conversation

@sandor-trombitas
Copy link
Copy Markdown
Contributor

@sandor-trombitas sandor-trombitas commented Jul 22, 2024

Summary

This PR changes the default download url to https://downloads.snyk.io, adds a backup URL that uses https://static.sn yk.io, for downloading the Snyk CLI

Changes

Motivation

This is done as part of our AKAMAI Ion <> Download Delivery migration

Testing

Tested the script to ensure:

  • Successful downloads from the main URL
  • Fallback to the backup URL when the main URL fails
  • Proper error handling if both URLs fail

Please review and test in your environment to ensure it meets our reliability standards.

@sandor-trombitas sandor-trombitas requested a review from a team as a code owner July 22, 2024 08:28
@sandor-trombitas sandor-trombitas force-pushed the CLI-427-update-cli-download-url branch 3 times, most recently from 5fd14c4 to 6b740f8 Compare July 22, 2024 08:39
@sandor-trombitas sandor-trombitas force-pushed the CLI-427-update-cli-download-url branch from 6b740f8 to 7c6dead Compare July 22, 2024 08:43
# $2: Output file name
download_file() {
# Try to download from the main URL
if curl --compressed --retry 2 --output "$2" "$MAIN_URL/$1?utm_source=GITHUB_ACTIONS"; then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion(magic strings): let's move the "GITHUB_ACTIONS" string to a var and reuse it in ln68 and for the SNYK_INTEGRATION_NAME parameter defined in ln44.

@j-luong j-luong merged commit 2db9624 into master Jul 26, 2024
@j-luong j-luong deleted the CLI-427-update-cli-download-url branch July 26, 2024 08:22
j-luong added a commit that referenced this pull request Jul 26, 2024
j-luong added a commit that referenced this pull request Jul 26, 2024
@j-luong j-luong restored the CLI-427-update-cli-download-url branch August 2, 2024 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants