From cf71ae042c24aecfe696a59e44002fcfc2bc6bd8 Mon Sep 17 00:00:00 2001 From: Hugo <10965479+hugoghx@users.noreply.github.com> Date: Thu, 7 Dec 2023 16:59:34 +0000 Subject: [PATCH] feat(github): Disable schema-diff for PRs in draft state (#4110) --- .github/workflows/schema-diff.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/schema-diff.yml b/.github/workflows/schema-diff.yml index 5622674756..5389babe81 100644 --- a/.github/workflows/schema-diff.yml +++ b/.github/workflows/schema-diff.yml @@ -2,6 +2,17 @@ name: schema-diff on: pull_request: + types: + # By default, a workflow only runs when a pull_request event's activity + # type is `opened`, `synchronize`, or `reopened`. + # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request + # Since we care about the PR state, we also need to run when there is a PR + # state change: From "Draft" to "Ready for Review" and vice-versa. + - 'opened' + - 'synchronize' + - 'reopened' + - 'converted_to_draft' + - 'ready_for_review' paths: - 'internal/db/schema/migrations/**/*.sql' - 'scripts/schema-diff.sh' @@ -16,6 +27,7 @@ permissions: jobs: schema-diff: name: "Schema Diff" + if: '! github.event.pull_request.draft' runs-on: ubuntu-latest steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1