From b94eb8a8b6a26681176381df964434e260142746 Mon Sep 17 00:00:00 2001 From: Jon Sumulong Date: Mon, 15 Apr 2024 16:02:23 -0500 Subject: [PATCH] Removed the 'prerelease' type and added conditional logic around updating param store MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .github/workflows/update-url.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/update-url.yml b/.github/workflows/update-url.yml index 7ef2cbb..813d19c 100644 --- a/.github/workflows/update-url.yml +++ b/.github/workflows/update-url.yml @@ -2,7 +2,7 @@ name: Update Download URL on: release: - types: [published, prereleased] + types: [published] jobs: run: runs-on: ubuntu-latest @@ -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