Skip to content

Commit

Permalink
Removed the 'prerelease' type and added conditional logic around upda…
Browse files Browse the repository at this point in the history
…ting param store

I was using the 'prerelease' type to debug values in the release event context. Now that we've got
the script sorted out, let's remove that type. We don't want to update the download URL on prerelease.

Also, it’s worth adding some conditional logic around those changes in the param store just in case we
don’t get a value from jq select (the filename we use for the desktop app has a convention and if we
upload a new version with a slightly different name, this would break)
  • Loading branch information
JSumulong committed Apr 15, 2024
1 parent 2b7d91e commit b94eb8a
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/update-url.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Update Download URL

on:
release:
types: [published, prereleased]
types: [published]
jobs:
run:
runs-on: ubuntu-latest
Expand All @@ -18,7 +18,12 @@ jobs:
MAC_DOWNLOAD_URL=$(jq -r '.release.assets[] | select(.browser_download_url | test("Check-Ins-.*\\.(pkg|dmg)$")) | .browser_download_url' $GITHUB_EVENT_PATH)
WIN_DOWNLOAD_URL=$(jq -r '.release.assets[] | select(.browser_download_url | test("Check-Ins-Setup-.*\\.exe$")) | .browser_download_url' $GITHUB_EVENT_PATH)
aws ssm put-parameter --name /application/parameters/check-ins/production/github/check-ins/desktop_app_download_url_mac --value $MAC_DOWNLOAD_URL --overwrite
aws ssm put-parameter --name /application/parameters/check-ins/staging/github/check-ins/desktop_app_download_url_mac --value $MAC_DOWNLOAD_URL --overwrite
aws ssm put-parameter --name /application/parameters/check-ins/production/github/check-ins/desktop_app_download_url_win --value $WIN_DOWNLOAD_URL --overwrite
aws ssm put-parameter --name /application/parameters/check-ins/staging/github/check-ins/desktop_app_download_url_win --value $WIN_DOWNLOAD_URL --overwrite
if [[ -n "$MAC_DOWNLOAD_URL" ]]; then
aws ssm put-parameter --name /application/parameters/check-ins/production/github/check-ins/desktop_app_download_url_mac --value $MAC_DOWNLOAD_URL --overwrite
aws ssm put-parameter --name /application/parameters/check-ins/staging/github/check-ins/desktop_app_download_url_mac --value $MAC_DOWNLOAD_URL --overwrite
fi
if [[ -n "$WIN_DOWNLOAD_URL" ]]; then
aws ssm put-parameter --name /application/parameters/check-ins/production/github/check-ins/desktop_app_download_url_win --value $WIN_DOWNLOAD_URL --overwrite
aws ssm put-parameter --name /application/parameters/check-ins/staging/github/check-ins/desktop_app_download_url_win --value $WIN_DOWNLOAD_URL --overwrite
fi

0 comments on commit b94eb8a

Please sign in to comment.