From 70524356683df8e1261f26b5a356fb353dc59252 Mon Sep 17 00:00:00 2001 From: tomiir Date: Tue, 5 Nov 2024 19:34:29 +0100 Subject: [PATCH] fix: publish canary workflow. add danger rule (#3204) --- .github/workflows/publish_canary.yml | 2 +- dangerfile.ts | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish_canary.yml b/.github/workflows/publish_canary.yml index 71f097547c..f32d14503e 100644 --- a/.github/workflows/publish_canary.yml +++ b/.github/workflows/publish_canary.yml @@ -1,4 +1,4 @@ -ame: Publish Canary Image +name: Publish Canary Image on: workflow_dispatch: push: diff --git a/dangerfile.ts b/dangerfile.ts index 7f85bb9304..93a92384e6 100644 --- a/dangerfile.ts +++ b/dangerfile.ts @@ -388,3 +388,18 @@ async function checkChangesetFiles() { } } checkChangesetFiles() + +// -- Check Workflows ------------------------------------------------------------ +function checkWorkflows() { + const updatedWorkflows = updated_files.filter(f => f.includes('.github/workflows/')) + const deletedWorkflows = deleted_files.filter(f => f.includes('.github/workflows/')) + + for (const f of deletedWorkflows) { + fail(`Workflow file(s) ${f} has been deleted`) + } + + for (const f of updatedWorkflows) { + warn(`Workflow file ${f} has been modified`) + } +} +checkWorkflows()