From ae3ca79999d8da5a21dd502472d94d7dc7fa65ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christopher=20All=C3=A8ne?= <66381046+callms@users.noreply.github.com> Date: Thu, 3 Aug 2023 08:55:39 +0200 Subject: [PATCH] Improve live URLs, fix some bugs, improve readability (#69) * Add support for user repository variables for AWS_AMPLIFY_URI and AWS_STORYBOOK_AMPLIFY_URI * Improve error message when ticket might not be in the Current Sprint board * Improve readability of Amplify live URLs --- README.md | 5 ++++- action.js | 7 +++++-- sample/workflows/asana.yml | 4 ++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d3c98e0e5..0743061c3 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,12 @@ The MS robot will automatically create a PR on your repository. ## Enable AWS Amplify custom domain If your repository is linked to AWS Amplify, you can dynamically update the -Amplify hostname link. To do so, create a secret in your repository named +Amplify hostname link. To do so, create a variable in your repository named `AWS_AMPLIFY_URI` with a value such as `https://pr-%.foo.live.mobsuccess.com`. +Note for legacy users: you can also setup a secret using the same name, albeit +the secret is less convenient because you can't easily edit its current value. + If your repository supports multiple domains, this value can be a JSON: ```json diff --git a/action.js b/action.js index f2a731c09..b6a07f383 100644 --- a/action.js +++ b/action.js @@ -362,7 +362,10 @@ exports.action = async function action() { try { return await actionImpl(); } catch (error) { - console.error(error); + console.error( + "Caught error while running action, is the Asana ticket in the Current Sprint board?" + ); + console.error(error, JSON.stringify(error.value)); core.setFailed(error.message); throw error; } @@ -419,7 +422,7 @@ async function actionImpl() { custom_fields: { ...(amplifyLiveUrls.length ? { - [customFieldLive.gid]: amplifyLiveUrls.join(" "), + [customFieldLive.gid]: amplifyLiveUrls.join("\n"), } : {}), ...(storybookAmplifyUri diff --git a/sample/workflows/asana.yml b/sample/workflows/asana.yml index ffe38f5c6..9e0211295 100644 --- a/sample/workflows/asana.yml +++ b/sample/workflows/asana.yml @@ -34,5 +34,5 @@ jobs: asana-pat: ${{ secrets.ASANA_PAT }} github-token: ${{ github.token }} action: "synchronize" - amplify-uri: ${{ secrets.AWS_AMPLIFY_URI }} - storybook-amplify-uri: ${{ secrets.AWS_STORYBOOK_AMPLIFY_URI }} + amplify-uri: ${{ secrets.AWS_AMPLIFY_URI }}${{ vars.AWS_AMPLIFY_URI }} + storybook-amplify-uri: ${{ secrets.AWS_STORYBOOK_AMPLIFY_URI }}${{ vars.AWS_STORYBOOK_AMPLIFY_URI }}