From 3afc20fae9bd4fa696b7e2c3f518a30ae3033116 Mon Sep 17 00:00:00 2001 From: Kevin Minehart Date: Thu, 13 Jul 2023 17:15:07 -0500 Subject: [PATCH] CI: Update and rename pr-patch-mirror-and-apply.yml to sync-mirror.yml (#71608) * CI: Update and rename pr-patch-mirror-and-apply.yml to sync-mirror.yml * update CODEOWNERS --- .github/CODEOWNERS | 2 +- .../{pr-patch-mirror-and-apply.yml => sync-mirror.yml} | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) rename .github/workflows/{pr-patch-mirror-and-apply.yml => sync-mirror.yml} (82%) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index b24e352f1da..1e527dc4156 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -613,7 +613,7 @@ embed.go @grafana/grafana-as-code /.github/workflows/pr-commands-closed.yml @tolzhabayev /.github/workflows/pr-commands.yml @marefr /.github/workflows/pr-patch-check.yml @grafana/grafana-delivery -/.github/workflows/pr-patch-mirror-and-apply.yml @grafana/grafana-delivery +/.github/workflows/sync-mirror.yml @grafana/grafana-delivery /.github/workflows/publish-technical-documentation-next.yml @grafana/docs-tooling /.github/workflows/publish-technical-documentation-release.yml @grafana/docs-tooling /.github/workflows/remove-milestone.yml @grafana/grafana-delivery diff --git a/.github/workflows/pr-patch-mirror-and-apply.yml b/.github/workflows/sync-mirror.yml similarity index 82% rename from .github/workflows/pr-patch-mirror-and-apply.yml rename to .github/workflows/sync-mirror.yml index dedf01cc754..3257e014791 100644 --- a/.github/workflows/pr-patch-mirror-and-apply.yml +++ b/.github/workflows/sync-mirror.yml @@ -3,9 +3,8 @@ name: Sync to mirror run-name: sync-to-mirror-${{ github.base_ref }}-${{ github.head_ref }} on: - pull_request_target: - types: - - closed + workflow_dispatch: + push: branches: - "main" - "v*.*.*" @@ -15,10 +14,10 @@ on: jobs: trigger_downstream_patch_mirror: concurrency: patch-mirror-${{ github.ref }} - if: github.event.pull_request.merged == true uses: grafana/security-patch-actions/.github/workflows/mirror-branch-and-apply-patches.yml@main + if: github.repository == 'grafana/grafana' with: - ref: "${{ github.base_ref }}" # this is the target branch name, Ex: "main" + ref: "${{ github.ref_name }}" # this is the target branch name, Ex: "main" src_repo: "${{ github.repository }}" dest_repo: "${{ github.repository }}-security-mirror" patch_repo: "${{ github.repository }}-security-patches"