Skip to content

Commit

Permalink
Improve live URLs, fix some bugs, improve readability (#69)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
callms authored Aug 3, 2023
1 parent de867eb commit ae3ca79
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions action.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -419,7 +422,7 @@ async function actionImpl() {
custom_fields: {
...(amplifyLiveUrls.length
? {
[customFieldLive.gid]: amplifyLiveUrls.join(" "),
[customFieldLive.gid]: amplifyLiveUrls.join("\n"),
}
: {}),
...(storybookAmplifyUri
Expand Down
4 changes: 2 additions & 2 deletions sample/workflows/asana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

0 comments on commit ae3ca79

Please sign in to comment.