From b15901df679ace69a0bde7c18dc0ef7a4c079ca1 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Tue, 12 Mar 2024 14:14:18 +0530 Subject: [PATCH] [workflows] Prevent duplicate runs of lint workflows after merging a PR --- .github/workflows/auth-lint.yml | 6 ++---- .github/workflows/mobile-lint.yml | 6 ++---- .github/workflows/server-lint.yml | 6 ++---- .github/workflows/web-lint.yml | 15 ++------------- 4 files changed, 8 insertions(+), 25 deletions(-) diff --git a/.github/workflows/auth-lint.yml b/.github/workflows/auth-lint.yml index fff7fb75f5..1b45a2d324 100644 --- a/.github/workflows/auth-lint.yml +++ b/.github/workflows/auth-lint.yml @@ -1,11 +1,9 @@ name: "Lint (auth)" on: - # Run on every push to branches (this also covers pull requests) + # Run on every push to a branch other than main that changes auth/ push: - # See: [Note: Specify branch when specifying a path filter] - branches: ["**"] - # Only run if something changes in these paths + branches-ignore: [main] paths: - "auth/**" - ".github/workflows/auth-lint.yml" diff --git a/.github/workflows/mobile-lint.yml b/.github/workflows/mobile-lint.yml index c2e54d38ae..7b5e5fbedb 100644 --- a/.github/workflows/mobile-lint.yml +++ b/.github/workflows/mobile-lint.yml @@ -1,11 +1,9 @@ name: "Lint (mobile)" on: - # Run on every push (this also covers pull requests) + # Run on every push to a branch other than main that changes mobile/ push: - # See: [Note: Specify branch when specifying a path filter] - branches: ["**"] - # Only run if something changes in these paths + branches-ignore: [main] paths: - "mobile/**" - ".github/workflows/mobile-lint.yml" diff --git a/.github/workflows/server-lint.yml b/.github/workflows/server-lint.yml index e23036a6ed..c051d02901 100644 --- a/.github/workflows/server-lint.yml +++ b/.github/workflows/server-lint.yml @@ -1,11 +1,9 @@ name: "Lint (server)" on: - # Run on every push (this also covers pull requests) + # Run on every push to a branch other than main that changes server/ push: - # See: [Note: Specify branch when specifying a path filter] - branches: ["**"] - # Only run if something changes in these paths + branches-ignore: [main] paths: - "server/**" - ".github/workflows/server-lint.yml" diff --git a/.github/workflows/web-lint.yml b/.github/workflows/web-lint.yml index a905069f67..7f5d270029 100644 --- a/.github/workflows/web-lint.yml +++ b/.github/workflows/web-lint.yml @@ -1,20 +1,9 @@ name: "Lint (web)" on: - # Run on every push (this also covers pull requests) + # Run on every push to a branch other than main that changes web/ push: - # [Note: Specify branch when specifying a path filter] - # - # Path filters are ignored for tag pushes, which causes this workflow to - # always run when we push a tag. Defining an explicit branch solves the - # issue. From GitHub's docs: - # - # > if you define both branches/branches-ignore and paths/paths-ignore, - # > the workflow will only run when both filters are satisfied. - # - # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions - branches: ["**"] - # Only run if something changes in these paths + branches-ignore: [main] paths: - "web/**" - ".github/workflows/web-lint.yml"