Skip to content

Commit

Permalink
Merge branch 'main' into feat/only-send-debug-images-referenced-in-th…
Browse files Browse the repository at this point in the history
…e-stacktrace-for-events
  • Loading branch information
martinhaintz authored Nov 18, 2024
2 parents 8394d2b + 18e6fd7 commit 1c07b01
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions .github/workflows/changes-in-high-risk-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,25 @@ jobs:
script: |
const highRiskFiles = process.env.high_risk_code;
const fileList = highRiskFiles.split(',').map(file => `- [ ] ${file}`).join('\n');
github.rest.issues.createComment({
// Get existing comments
const comments = await github.rest.issues.listComments({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `### 🚨 Detected changes in high risk code 🚨 \n High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:\n ${fileList}`
})
repo: context.repo.repo
});
// Check if we already have a high risk code comment
const hasExistingComment = comments.data.some(comment =>
comment.body.includes('🚨 Detected changes in high risk code 🚨')
);
// Only create comment if we don't already have one
if (!hasExistingComment) {
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `### 🚨 Detected changes in high risk code 🚨 \n High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:\n ${fileList}`
});
}

0 comments on commit 1c07b01

Please sign in to comment.