diff --git a/.github/workflows/update-url.yml b/.github/workflows/update-url.yml new file mode 100644 index 0000000..813d19c --- /dev/null +++ b/.github/workflows/update-url.yml @@ -0,0 +1,29 @@ +name: Update Download URL + +on: + release: + types: [published] +jobs: + run: + runs-on: ubuntu-latest + permissions: + id-token: write + steps: + - uses: aws-actions/configure-aws-credentials@v4 + with: + aws-region: us-east-1 + role-to-assume: ${{ secrets.AWS_IAM_ROLE_ARN }} + - name: update desktop download links + run: | + 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) + + 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