Skip to content

Duplicate Repository #14

Duplicate Repository

Duplicate Repository #14

Workflow file for this run

name: Duplicate Repository
on:
workflow_dispatch:
inputs:
destination_user:
description: 'Destination user or organization'
required: true
default: 'eidolon-ai'
destination_repo:
description: 'Name of the new repository'
required: true
visibility:
description: 'Repository visibility (public or private)'
required: true
default: 'public'
type: choice
options:
- public
- private
jobs:
duplicate_repository:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_PAT }}
fetch-depth: 0
- name: Create new repository
env:
GH_TOKEN: ${{ secrets.GH_PAT }}
run: gh repo create ${{ github.event.inputs.destination_user }}/${{ github.event.inputs.destination_repo }} --${{ github.event.inputs.visibility }}
- name: Push current branch to new repository as main
run: git push "https://github.com/${{ github.event.inputs.destination_user }}/${{ github.event.inputs.destination_repo }}.git" HEAD:main --force