diff options
| -rw-r--r-- | .github/workflows/pr-mirror-repo-sync.yml | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/.github/workflows/pr-mirror-repo-sync.yml b/.github/workflows/pr-mirror-repo-sync.yml index 184d878d4..047d109fc 100644 --- a/.github/workflows/pr-mirror-repo-sync.yml +++ b/.github/workflows/pr-mirror-repo-sync.yml @@ -1,28 +1,36 @@ name: PR Mirror and Repo Sync + on: pull_request_target: - types: - - closed - branches: - - current + types: [closed] + branches: [current] workflow_dispatch: inputs: sync_branch: - description: 'branch to sync' - required: false - type: string + description: 'Branch to mirror' + required: true default: 'current' + type: choice + options: + - current + permissions: pull-requests: write contents: write issues: write + jobs: - call-mirror-pr-repo-sync: - if: github.repository_owner == 'vyos' && github.event.pull_request.merged == true + 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: ${{ inputs.sync_branch }} + sync_branch: ${{ github.event.inputs.sync_branch || 'current' }} secrets: PAT: ${{ secrets.PAT }} REMOTE_OWNER: ${{ secrets.REMOTE_OWNER }} - REMOTE_REPO: ${{ secrets.REMOTE_REPO }}
\ No newline at end of file + REMOTE_REPO: ${{ secrets.REMOTE_REPO }} |
