Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions src/develop_actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,35 @@ const run = async () => {
base: "staging",
}
);
console.log("createPr", createpr?.data);
console.log(createpr?.data);
if (createpr?.data) {
axios
.post(
`${SLACK_WEBHOOK_URL}`,
`PR from ${branch_name} to staging was created successfully`
SLACK_WEBHOOK_URL,
JSON.stringify(
`PR from ${branch_name} to staging was created successfully`
)
)
.then((response) => {
console.log("SUCCEEDED: Sent slack webhook", response.data);
})
.catch((error) => {
console.log("FAILED: Send slack webhook", error);
});
} else {
// fetch pr from branch_name to staging
// update existing pr
console.log("pr exists");
axios
.post(
SLACK_WEBHOOK_URL,
JSON.stringify(`PR from ${branch_name} to staging already exist`)
)
.then((response) => {
console.log("SUCCEEDED: Sent slack webhook", response.data);
resolve(response.data);
})
.catch((error) => {
console.log("FAILED: Send slack webhook", error);
reject(new Error("FAILED: Send slack webhook"));
});
}
const compare_commits = await octokit.request(
Expand Down