Duplicate Repository #14
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |