Skip to content

Commit

Permalink
chore: test comment deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
JivusAyrus committed Sep 4, 2024
1 parent 2b6b912 commit fb402c8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ const update = async ({
featureSubgraphsToDeploy.push({
featureSubgraphName,
schemaPath: subgraph.schemaPath,
routingUrl: subgraph.routingUrl,
routingUrl: routingURL,
baseSubgraphName: subgraph.name,
});
}
Expand Down
20 changes: 20 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,26 @@ export const addComment = async ({
}) => {
const octokit = github.getOctokit(githubToken);

const comments = await octokit.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
});

for (const comment of comments.data) {
if (
comment.body &&
(comment.body.startsWith('### 🚀 The following feature flags have been deployed:') ||
comment.body.startsWith('\n ### ❌ The following feature flags failed to deploy in these federated graphs:'))
) {
await octokit.rest.issues.deleteComment({
comment_id: comment.id,
owner: context.repo.owner,
repo: context.repo.repo,
});
}
}

// Generate Markdown table
const tableHeader = '| Feature Flag | Feature Subgraphs |\n| --- | --- |\n';
const tableBody = deployedFeatureFlags.map((name) => {
Expand Down

0 comments on commit fb402c8

Please sign in to comment.