extension_ci: Do not trigger version bump on workflow file changes (#44077)

Finn Evers and Agus Zubiaga created

Release Notes:

- N/A

Co-authored-by: Agus Zubiaga <agus@zed.dev>

Change summary

Cargo.lock                                                   |  4 +-
Cargo.toml                                                   |  2 
extensions/workflows/bump_version.yml                        |  3 +
tooling/xtask/src/tasks/workflows/extensions/bump_version.rs | 12 ++++-
4 files changed, 15 insertions(+), 6 deletions(-)

Detailed changes

Cargo.lock 🔗

@@ -6972,7 +6972,7 @@ dependencies = [
 [[package]]
 name = "gh-workflow"
 version = "0.8.0"
-source = "git+https://github.com/zed-industries/gh-workflow?rev=e5f883040530b4df36437f140084ee5cc7c1c9be#e5f883040530b4df36437f140084ee5cc7c1c9be"
+source = "git+https://github.com/zed-industries/gh-workflow?rev=09acfdf2bd5c1d6254abefd609c808ff73547b2c#09acfdf2bd5c1d6254abefd609c808ff73547b2c"
 dependencies = [
  "async-trait",
  "derive_more 2.0.1",
@@ -6989,7 +6989,7 @@ dependencies = [
 [[package]]
 name = "gh-workflow-macros"
 version = "0.8.0"
-source = "git+https://github.com/zed-industries/gh-workflow?rev=e5f883040530b4df36437f140084ee5cc7c1c9be#e5f883040530b4df36437f140084ee5cc7c1c9be"
+source = "git+https://github.com/zed-industries/gh-workflow?rev=09acfdf2bd5c1d6254abefd609c808ff73547b2c#09acfdf2bd5c1d6254abefd609c808ff73547b2c"
 dependencies = [
  "heck 0.5.0",
  "quote",

Cargo.toml 🔗

@@ -508,7 +508,7 @@ fork = "0.4.0"
 futures = "0.3"
 futures-batch = "0.6.1"
 futures-lite = "1.13"
-gh-workflow = { git = "https://github.com/zed-industries/gh-workflow", rev = "e5f883040530b4df36437f140084ee5cc7c1c9be" }
+gh-workflow = { git = "https://github.com/zed-industries/gh-workflow", rev = "09acfdf2bd5c1d6254abefd609c808ff73547b2c" }
 git2 = { version = "0.20.1", default-features = false }
 globset = "0.4"
 handlebars = "4.3"

extensions/workflows/bump_version.yml 🔗

@@ -8,6 +8,9 @@ on:
   push:
     branches:
     - main
+    paths-ignore:
+    - .github/**
+  workflow_dispatch: {}
 jobs:
   determine_bump_type:
     runs-on: namespace-profile-16x32-ubuntu-2204

tooling/xtask/src/tasks/workflows/extensions/bump_version.rs 🔗

@@ -1,5 +1,6 @@
 use gh_workflow::{
-    Event, Expression, Input, Job, PullRequest, PullRequestType, Push, Run, Step, UsesJob, Workflow,
+    Event, Expression, Input, Job, PullRequest, PullRequestType, Push, Run, Step, UsesJob,
+    Workflow, WorkflowDispatch,
 };
 use indexmap::IndexMap;
 use indoc::indoc;
@@ -18,8 +19,13 @@ pub(crate) fn bump_version() -> Workflow {
 
     named::workflow()
         .on(Event::default()
-            .push(Push::default().add_branch("main"))
-            .pull_request(PullRequest::default().add_type(PullRequestType::Labeled)))
+            .push(
+                Push::default()
+                    .add_branch("main")
+                    .add_ignored_path(".github/**"),
+            )
+            .pull_request(PullRequest::default().add_type(PullRequestType::Labeled))
+            .workflow_dispatch(WorkflowDispatch::default()))
         .concurrency(one_workflow_per_non_main_branch_and_token("labels"))
         .add_job(determine_bump_type.name, determine_bump_type.job)
         .add_job(call_bump_version.name, call_bump_version.job)