From fdd616fa32cb2943d45f7105d48731ec3635e8eb Mon Sep 17 00:00:00 2001 From: kumvijaya Date: Sun, 27 Jul 2025 14:30:19 +0530 Subject: [PATCH] T7644: mirror workflow refactoring rollout --- .../workflows/cleanup-mirror-pr-branch.yml | 16 --------- .github/workflows/mirror-pr-and-sync.yml | 21 ----------- .github/workflows/pr-mirror-repo-sync.yml | 35 +++++++++++++++++++ .../workflows/trigger-pr-mirror-repo-sync.yml | 18 ---------- 4 files changed, 35 insertions(+), 55 deletions(-) delete mode 100644 .github/workflows/cleanup-mirror-pr-branch.yml delete mode 100644 .github/workflows/mirror-pr-and-sync.yml create mode 100644 .github/workflows/pr-mirror-repo-sync.yml delete mode 100644 .github/workflows/trigger-pr-mirror-repo-sync.yml diff --git a/.github/workflows/cleanup-mirror-pr-branch.yml b/.github/workflows/cleanup-mirror-pr-branch.yml deleted file mode 100644 index a62e44b2..00000000 --- a/.github/workflows/cleanup-mirror-pr-branch.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Cleanup pr mirror branch - -on: - pull_request: - types: [closed] - branches: - - current - -permissions: - contents: write - -jobs: - call-delete-branch: - if: github.repository_owner != 'vyos' - uses: vyos/.github/.github/workflows/cleanup-mirror-pr-branch.yml@current - secrets: inherit diff --git a/.github/workflows/mirror-pr-and-sync.yml b/.github/workflows/mirror-pr-and-sync.yml deleted file mode 100644 index 120e116d..00000000 --- a/.github/workflows/mirror-pr-and-sync.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Create Mirror PR and Repo Sync -on: - workflow_dispatch: - inputs: - sync_branch: - description: 'branch to sync' - required: true - type: string - -permissions: - pull-requests: write - contents: write - -jobs: - call-mirror-pr-and-sync: - if: github.repository_owner != 'vyos' - uses: VyOS-Networks/vyos-reusable-workflows/.github/workflows/mirror-pr-and-sync.yml@main - with: - sync_branch: ${{ inputs.sync_branch }} - secrets: - PAT: ${{ secrets.PAT }} diff --git a/.github/workflows/pr-mirror-repo-sync.yml b/.github/workflows/pr-mirror-repo-sync.yml new file mode 100644 index 00000000..88fb563c --- /dev/null +++ b/.github/workflows/pr-mirror-repo-sync.yml @@ -0,0 +1,35 @@ +name: PR Mirror and Repo Sync + +on: + pull_request_target: + types: [closed] + branches: [current] + workflow_dispatch: + inputs: + sync_branch: + description: 'Branch to mirror' + required: true + default: 'current' + type: choice + options: + - current + +permissions: + pull-requests: write + contents: write + issues: write + +jobs: + call-pr-mirror-repo-sync: + if: | + github.repository_owner == 'vyos' && + ( + github.event_name == 'workflow_dispatch' || + (github.event_name == 'pull_request_target' && github.event.pull_request.merged == true) + ) + uses: vyos/.github/.github/workflows/pr-mirror-repo-sync.yml@current + with: + sync_branch: ${{ github.event.inputs.sync_branch || 'current' }} + secrets: + PAT: ${{ secrets.PAT }} + REMOTE_OWNER: ${{ secrets.REMOTE_OWNER }} diff --git a/.github/workflows/trigger-pr-mirror-repo-sync.yml b/.github/workflows/trigger-pr-mirror-repo-sync.yml deleted file mode 100644 index 7b4a241f..00000000 --- a/.github/workflows/trigger-pr-mirror-repo-sync.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Trigger Mirror PR and Repo Sync -on: - pull_request_target: - types: - - closed - branches: - - current - -permissions: - pull-requests: write - contents: write - issues: write - -jobs: - call-trigger-mirror-pr-repo-sync: - if: github.repository_owner == 'vyos' && github.event.pull_request.merged == true - uses: vyos/.github/.github/workflows/trigger-pr-mirror-repo-sync.yml@current - secrets: inherit