From aa8a094710846fc92a0d214495cc9b8863b89b2c Mon Sep 17 00:00:00 2001 From: flagarde Date: Fri, 20 Sep 2024 12:16:28 +0800 Subject: [PATCH] Only run workflows when necessary --- .github/workflows/codeql-analysis.yml | 14 +++++++++----- .github/workflows/cpp-linter.yml | 6 ++++++ .github/workflows/dockcross.yml | 6 ++++++ .github/workflows/docs.yml | 6 ++++++ .github/workflows/linux.yml | 6 ++++++ .github/workflows/macOS.yml | 6 ++++++ .github/workflows/windows.yml | 6 ++++++ 7 files changed, 45 insertions(+), 5 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index cae70e07..18d49d33 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -1,21 +1,25 @@ --- name: CodeQL -permissions: - actions: read - contents: read - security-events: write - on: push: paths-ignore: - "dependabot/**" + - '.github/workflows/**' + - '!.github/workflows/codeql-analysis.yml' pull_request: branches: - "dependabot/**" + - '.github/workflows/**' + - '!.github/workflows/codeql-analysis.yml' schedule: - cron: '18 23 * * 1' +permissions: + actions: read + contents: read + security-events: write + jobs: analyze: name: Analyze diff --git a/.github/workflows/cpp-linter.yml b/.github/workflows/cpp-linter.yml index b11203e9..3ee581a2 100644 --- a/.github/workflows/cpp-linter.yml +++ b/.github/workflows/cpp-linter.yml @@ -2,7 +2,13 @@ name: cpp-linter on: push: + paths-ignore: + - '.github/workflows/**' + - '!.github/workflows/cpp-linter.yml' pull_request: + paths-ignore: + - '.github/workflows/**' + - '!.github/workflows/cpp-linter.yml' workflow_dispatch: jobs: diff --git a/.github/workflows/dockcross.yml b/.github/workflows/dockcross.yml index 6c8de9c1..ac24fbd6 100644 --- a/.github/workflows/dockcross.yml +++ b/.github/workflows/dockcross.yml @@ -3,7 +3,13 @@ name: Dockcross on: push: + paths-ignore: + - '.github/workflows/**' + - '!.github/workflows/dockcross.yml' pull_request: + paths-ignore: + - '.github/workflows/**' + - '!.github/workflows/dockcross.yml' workflow_dispatch: concurrency: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index ff6d7b73..e277be1a 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -3,7 +3,13 @@ name: docs on: push: + paths-ignore: + - '.github/workflows/**' + - '!.github/workflows/docs.yml' pull_request: + paths-ignore: + - '.github/workflows/**' + - '!.github/workflows/docs.yml' workflow_dispatch: # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index f77e9be1..d08f1080 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -3,7 +3,13 @@ name: Linux on: push: + paths-ignore: + - '.github/workflows/**' + - '!.github/workflows/linux.yml' pull_request: + paths-ignore: + - '.github/workflows/**' + - '!.github/workflows/linux.yml' workflow_dispatch: concurrency: diff --git a/.github/workflows/macOS.yml b/.github/workflows/macOS.yml index c52b651d..d6269daf 100644 --- a/.github/workflows/macOS.yml +++ b/.github/workflows/macOS.yml @@ -3,7 +3,13 @@ name: macOS on: push: + paths-ignore: + - '.github/workflows/**' + - '!.github/workflows/macOS.yml' pull_request: + paths-ignore: + - '.github/workflows/**' + - '!.github/workflows/macOS.yml' workflow_dispatch: concurrency: diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 252cec78..6b40f629 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -3,7 +3,13 @@ name: Windows on: push: + paths-ignore: + - '.github/workflows/**' + - '!.github/workflows/windows.yml' pull_request: + paths-ignore: + - '.github/workflows/**' + - '!.github/workflows/windows.yml' workflow_dispatch: concurrency: