Skip to content

Commit

Permalink
Stage pr created to slack stage (#2572)
Browse files Browse the repository at this point in the history
* Send slack messages only once & improvements

* Don't go into the catch block for slack messages
  • Loading branch information
mokimo authored Jul 17, 2024
1 parent d932b35 commit ba623c3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 0 additions & 1 deletion .github/workflows/merge-to-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:

env:
MILO_RELEASE_SLACK_WH: ${{ secrets.MILO_RELEASE_SLACK_WH }}
MILO_STAGE_SLACK_WH: ${{secrets.MILO_STAGE_SLACK_WH}}

jobs:
merge-to-main:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/merge-to-stage.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ const merge = async ({ prs, type }) => {
try {
if (files.some((file) => SEEN[file])) {
commentOnPR(
`Skipped ${number}: ${title} due to file overlap. Merging will be attempted in the next batch`,
`Skipped ${number}: ${title} due to file "${file}" overlap. Merging will be attempted in the next batch`,
number
);
continue;
Expand All @@ -157,10 +157,11 @@ const merge = async ({ prs, type }) => {
number,
title,
prefix,
})
}).catch(console.error)
);
await new Promise((resolve) => setTimeout(resolve, 5000));
} catch (error) {
files.forEach((file) => (SEEN[file] = false));
commentOnPR(`Error merging ${number}: ${title} ` + error.message, number);
}
}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/merge-to-stage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ env:
MILO_RELEASE_SLACK_WH: ${{ secrets.MILO_RELEASE_SLACK_WH }}
REQUIRED_APPROVALS: ${{ secrets.REQUIRED_APPROVALS }}
SLACK_HIGH_IMPACT_PR_WEBHOOK: ${{ secrets.SLACK_HIGH_IMPACT_PR_WEBHOOK }}
MILO_STAGE_SLACK_WH: ${{secrets.MILO_STAGE_SLACK_WH}}

jobs:
merge-to-stage:
Expand Down

0 comments on commit ba623c3

Please sign in to comment.