From b08510ac6a149abc23362df7b6f2ddc81ca75403 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20Cobles?= <68897552+ocobles@users.noreply.github.com> Date: Tue, 24 Oct 2023 17:04:22 +0200 Subject: [PATCH] chore(ci): execute acctest only if pull request is not draft (#421) in response to this https://github.com/equinix/terraform-provider-equinix/pull/406#issuecomment-1757739775 --------- Signed-off-by: ocobleseqx --- .github/workflows/acctest.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/acctest.yml b/.github/workflows/acctest.yml index 4379e867a..822bf66a8 100644 --- a/.github/workflows/acctest.yml +++ b/.github/workflows/acctest.yml @@ -4,11 +4,16 @@ name: Acceptance Tests # (which means it was made by us and can run immediately). Once a PR # is approved, the PR code gains access to secrets referenced in this # workflow. -# Any changes to this job, even from internal contributors, require -# heavy scrutiny. + +# The 'build' job and subsequent jobs, are executed only when the pull +# request is not a draft, regardless of whether it is from an internal +# branch or external fork. + +# Any changes to this job, even from internal contributors, require heavy scrutiny. on: pull_request_target: + types: [opened, synchronize, reopened, ready_for_review] paths-ignore: - 'LICENSE' - '**.md' @@ -22,7 +27,9 @@ permissions: contents: read jobs: + authorize: + if: (github.event_name == 'workflow_dispatch') || (github.event_name == 'pull_request_target' && github.event.pull_request.draft == false) environment: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository &&