From a3565e5c0c7182681bdbe705d6ee00f8bac12939 Mon Sep 17 00:00:00 2001 From: kei-g Date: Sat, 14 Jan 2023 20:29:33 +0900 Subject: [PATCH] :green_heart: Run workflows only on 'push' or 'pull request' events for branches Signed-off-by: kei-g --- .github/workflows/build.yml | 15 +++------------ .github/workflows/codeql.yml | 11 +++-------- .github/workflows/coverage.yml | 15 +++------------ .github/workflows/example.yml | 15 +++------------ 4 files changed, 12 insertions(+), 44 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 907e5732..adf16cce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,6 @@ jobs: build: + if: github.ref_type == 'branch' name: Build on Node.js ${{ matrix.node }} runs-on: ubuntu-latest strategy: @@ -28,17 +29,7 @@ name: Build on: pull_request: branches: - - devel - - main - - release + - '**' push: branches: - - devel - - main - - release - paths-ignore: - - '**.md' - - '.editorconfig' - - '.gitignore' - - '.npmignore' - - 'LICENSE' + - '**' diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 538f9f7f..89305b75 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -1,5 +1,6 @@ jobs: analyze: + if: github.ref_type == 'branch' name: Analyze permissions: actions: read @@ -28,13 +29,7 @@ name: CodeQL on: pull_request: branches: - - devel - - main - - release + - '**' push: branches: - - devel - - main - - release - schedule: - - cron: '19 13 * * 3' + - '**' diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 10cc75fd..670cf6d0 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,5 +1,6 @@ jobs: coverage: + if: github.ref_type == 'branch' name: Check code coverages on Node.js ${{ matrix.node }} runs-on: ubuntu-latest strategy: @@ -34,17 +35,7 @@ name: Coverage on: pull_request: branches: - - devel - - main - - release + - '**' push: branches: - - devel - - main - - release - paths-ignore: - - '**.md' - - '.editorconfig' - - '.gitignore' - - '.npmignore' - - 'LICENSE' + - '**' diff --git a/.github/workflows/example.yml b/.github/workflows/example.yml index 00dacfff..bb11c771 100644 --- a/.github/workflows/example.yml +++ b/.github/workflows/example.yml @@ -1,5 +1,6 @@ jobs: example: + if: github.ref_type == 'branch' name: Run an example on Node.js ${{ matrix.node }} outputs: result: ${{ steps.example.outputs.result }} @@ -30,17 +31,7 @@ name: Example on: pull_request: branches: - - devel - - main - - release + - '**' push: branches: - - devel - - main - - release - paths-ignore: - - '**.md' - - '.editorconfig' - - '.gitignore' - - '.npmignore' - - 'LICENSE' + - '**'