feat: add ci skip check

This commit is contained in:
izayl
2025-01-16 16:26:28 +08:00
parent 351e4b6103
commit 4e724d88aa

View File

@@ -71,6 +71,23 @@ export default async function handler(
return;
}
// skip workflow runs use keywords
// @link https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-workflow-runs/skipping-workflow-runs
if (
[
"[skip ci]",
"[ci skip]",
"[no ci]",
"[skip actions]",
"[actions skip]",
].find((keyword) =>
extractCommitMessage(req.headers, req.body).includes(keyword),
)
) {
res.status(200).json({ message: "Deployment skipped" });
return;
}
if (req.headers["x-github-event"] === "push") {
try {
const branchName = githubBody?.ref?.replace("refs/heads/", "");