From ef500ffa0fa72c4a4053632d714c795ebdbb2a47 Mon Sep 17 00:00:00 2001 From: Melvin Wang Date: Mon, 22 Jan 2024 15:40:51 -0800 Subject: [PATCH] ci: trigger github actions on merge_group (#74) --- .github/workflows/build.yaml | 1 + .github/workflows/cargo-audit.yaml | 1 + .github/workflows/code-formatting-check.yaml | 1 + .github/workflows/docs.yaml | 1 + .github/workflows/github-dependency-review.yaml | 7 +++++++ .github/workflows/lint.yaml | 1 + .github/workflows/test.yaml | 1 + 7 files changed, 13 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 439d4045..0d9f1c4f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,6 +1,7 @@ on: push: pull_request: + merge_group: schedule: # Trigger a job on default branch at 4AM PST everyday - cron: "0 11 * * *" diff --git a/.github/workflows/cargo-audit.yaml b/.github/workflows/cargo-audit.yaml index e0f617fe..63e7ff0a 100644 --- a/.github/workflows/cargo-audit.yaml +++ b/.github/workflows/cargo-audit.yaml @@ -5,6 +5,7 @@ on: - "**/Cargo.toml" - "**/Cargo.lock" pull_request: + merge_group: schedule: # Trigger a job on default branch at 4AM PST everyday - cron: 0 11 * * * diff --git a/.github/workflows/code-formatting-check.yaml b/.github/workflows/code-formatting-check.yaml index 8b14708d..07d7d7ed 100644 --- a/.github/workflows/code-formatting-check.yaml +++ b/.github/workflows/code-formatting-check.yaml @@ -2,6 +2,7 @@ name: Code Formatting Check on: push: pull_request: + merge_group: schedule: # Trigger a job on default branch at 4AM PST everyday - cron: 0 11 * * * diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 75cc1d4e..86d31bce 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -1,6 +1,7 @@ on: push: pull_request: + merge_group: schedule: # Trigger a job on default branch at 4AM PST everyday - cron: "0 11 * * *" diff --git a/.github/workflows/github-dependency-review.yaml b/.github/workflows/github-dependency-review.yaml index af560c18..77d7ed9c 100644 --- a/.github/workflows/github-dependency-review.yaml +++ b/.github/workflows/github-dependency-review.yaml @@ -1,6 +1,8 @@ name: Dependency Review on: + push: pull_request: + merge_group: jobs: dependency-review: @@ -19,3 +21,8 @@ jobs: with: allow-licenses: MIT, Apache-2.0 comment-summary-in-pr: on-failure + # Explicit refs required for merge_group and push triggers: + # https://github.com/actions/dependency-review-action/issues/456 + # https://github.com/actions/dependency-review-action/issues/252 + base-ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || (github.event_name == 'push' && github.event.before || (github.event_name == 'merge_group' && 'main' || 'unsupported trigger' ) ) }} + head-ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || (github.event_name == 'push' && github.sha || (github.event_name == 'merge_group' && github.ref || 'unsupported trigger' ) ) }} diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 44e6dd01..1b41e18a 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -1,6 +1,7 @@ on: push: pull_request: + merge_group: schedule: # Trigger a job on default branch at 4AM PST everyday - cron: "0 11 * * *" diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index eed155f7..c168d7c3 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,6 +1,7 @@ on: push: pull_request: + merge_group: schedule: # Trigger a job on default branch at 4AM PST everyday - cron: "0 11 * * *"