diff options
author | Vijayakumar A <36878324+kumvijaya@users.noreply.github.com> | 2025-02-17 00:31:35 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-16 20:01:35 +0100 |
commit | 48fb37eca39bd989e8310f4de261759bb169ec6c (patch) | |
tree | 498b7e052c4d929b038c03c0ce8326b4f37dc52d | |
parent | ae3a66c3f3815e80ca74d4e196d02c85289a0fa2 (diff) | |
download | vyos-build-48fb37eca39bd989e8310f4de261759bb169ec6c.tar.gz vyos-build-48fb37eca39bd989e8310f4de261759bb169ec6c.zip |
T7172: added workflow checks to make current as default in private repo (#910)
* T7172: added workflow checks to making current as default in private repo
---------
Co-authored-by: kumvijaya <kuvmijaya@gmail.com>
-rw-r--r-- | .github/workflows/cleanup-mirror-pr-branch.yml | 1 | ||||
-rw-r--r-- | .github/workflows/mirror-pr-and-sync.yml | 26 | ||||
-rw-r--r-- | .github/workflows/repo-sync.yml | 17 | ||||
-rw-r--r-- | .github/workflows/trigger-pr-mirror-repo-sync.yml | 1 |
4 files changed, 28 insertions, 17 deletions
diff --git a/.github/workflows/cleanup-mirror-pr-branch.yml b/.github/workflows/cleanup-mirror-pr-branch.yml index bbe6aa2f..a62e44b2 100644 --- a/.github/workflows/cleanup-mirror-pr-branch.yml +++ b/.github/workflows/cleanup-mirror-pr-branch.yml @@ -11,5 +11,6 @@ permissions: 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 new file mode 100644 index 00000000..48a67a43 --- /dev/null +++ b/.github/workflows/mirror-pr-and-sync.yml @@ -0,0 +1,26 @@ +name: Create Mirror PR and Repo Sync +on: + workflow_dispatch: + inputs: + pr_number: + description: 'Source repo PR Number' + required: true + type: string + 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: + pr_number: ${{ inputs.pr_number }} + sync_branch: ${{ inputs.sync_branch }} + secrets: + PAT: ${{ secrets.PAT }} diff --git a/.github/workflows/repo-sync.yml b/.github/workflows/repo-sync.yml deleted file mode 100644 index 6da2fb40..00000000 --- a/.github/workflows/repo-sync.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Repo-sync - -on: - pull_request_target: - types: - - closed - branches: - - current - workflow_dispatch: - -jobs: - trigger-sync: - uses: vyos/.github/.github/workflows/trigger-repo-sync.yml@current - secrets: - REMOTE_REPO: ${{ secrets.REMOTE_REPO }} - REMOTE_OWNER: ${{ secrets.REMOTE_OWNER }} - PAT: ${{ secrets.PAT }} diff --git a/.github/workflows/trigger-pr-mirror-repo-sync.yml b/.github/workflows/trigger-pr-mirror-repo-sync.yml index d5e8ce3b..f7489598 100644 --- a/.github/workflows/trigger-pr-mirror-repo-sync.yml +++ b/.github/workflows/trigger-pr-mirror-repo-sync.yml @@ -8,5 +8,6 @@ on: 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 |