Skip to content

Commit

Permalink
chore: update action
Browse files Browse the repository at this point in the history
  • Loading branch information
JivusAyrus committed Aug 20, 2024
1 parent 50cde84 commit 303251b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const addComment = async ({
// Generate Markdown table
const tableHeader = '| Feature Flag | Feature Subgraphs |\n| --- | --- |\n';
const tableBody = deployedFeatureFlags.map((name) => {
return `| [${name}](https://cosmo.wundergraph.com/${organizationSlug}/feature-flags?namespace=${namespace}) | ${featureSubgraphs.join(', ')} |`;
return `| [${name}](https://cosmo.wundergraph.com/${organizationSlug}/feature-flags/${name}?namespace=${namespace}) | ${featureSubgraphs.join(', ')} |`;
});
const markdownTable = `${tableHeader}${tableBody}`;

Expand All @@ -51,16 +51,16 @@ export const addComment = async ({
const compositionErrors = featureFlagErrorOutputs[name].compositionErrors;
const compositionError = compositionErrors.find((error) => error.featureFlag === name);
return compositionError
? `| [${name}](https://cosmo.wundergraph.com/${organizationSlug}/feature-flags?namespace=${namespace}) | ${compositionError.federatedGraphName} | ${compositionError.message.replaceAll('\n', '<br>')} |`
: `| [${name}](https://cosmo.wundergraph.com/${organizationSlug}/feature-flags?namespace=${namespace}) | - | ${featureFlagErrorOutputs[name].message}. Please check the compositions page for more details. |`;
? `| [${name}](https://cosmo.wundergraph.com/${organizationSlug}/feature-flags/${name}?namespace=${namespace}) | ${compositionError.federatedGraphName} | ${compositionError.message.replaceAll('\n', '<br>')} |`
: `| [${name}](https://cosmo.wundergraph.com/${organizationSlug}/feature-flags/${name}?namespace=${namespace}) | - | ${featureFlagErrorOutputs[name].message}. Please check the compositions page for more details. |`;
} else if (featureFlagErrorOutputs[name].deploymentErrors.length > 0) {
const deploymentErrors = featureFlagErrorOutputs[name].deploymentErrors;
const deploymentError = deploymentErrors.find((error) => error.featureFlag === name);
return deploymentError
? `| [${name}](https://cosmo.wundergraph.com/${organizationSlug}/feature-flags?namespace=${namespace}) | ${deploymentError.federatedGraphName} | ${deploymentError.message.replaceAll('\n', '<br>')} |`
: `| [${name}](https://cosmo.wundergraph.com/${organizationSlug}/feature-flags?namespace=${namespace}) | - | ${featureFlagErrorOutputs[name].message} |`;
? `| [${name}](https://cosmo.wundergraph.com/${organizationSlug}/feature-flags/${name}?namespace=${namespace}) | ${deploymentError.federatedGraphName} | ${deploymentError.message.replaceAll('\n', '<br>')} |`
: `| [${name}](https://cosmo.wundergraph.com/${organizationSlug}/feature-flags/${name}?namespace=${namespace}) | - | ${featureFlagErrorOutputs[name].message} |`;
} else {
return `| [${name}](https://cosmo.wundergraph.com/${organizationSlug}/feature-flags?namespace=${namespace}) | - | ${featureFlagErrorOutputs[name].message} |`;
return `| [${name}](https://cosmo.wundergraph.com/${organizationSlug}/feature-flags/${name}?namespace=${namespace}) | - | ${featureFlagErrorOutputs[name].message} |`;
}
});
const failedFFMarkdownTable = `${failedFFTableHeader}${failedFFTableBody}`;
Expand Down

0 comments on commit 303251b

Please sign in to comment.