Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub private fork #21

Open
jschenke488 opened this issue Jan 28, 2023 · 2 comments
Open

GitHub private fork #21

jschenke488 opened this issue Jan 28, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request forlater Something for later

Comments

@jschenke488
Copy link
Contributor

name: hehe

on:
  workflow_dispatch:
  schedule:
    - cron: '0 10 * * *'

jobs:
  hehe:
    runs-on: ubuntu-latest
    if: github.repository == 'FRCTeam1987/3061-lib'

    steps:
      - name: Run a multi-line script
        run: |
          git config --global user.name "Jay"
          git config --global user.email "[email protected]"
          git clone --mirror https://github.com/jschenke488/3061-lib 3061-lib
          cd 3061-lib
          git remote remove origin
          git remote add origin https://jschenke488:${{ secrets.GIT_TOKEN }}@github.com/FRCTeam1987/3061-lib
          git push -f --prune --all
          git push -f --prune --tag

This GitHub action can be put inside a blank private repository and then that private repo can be forked to create a private fork. It's stupid, but it works.

@jschenke488
Copy link
Contributor Author

I tested to confirm this works in https://github.com/FRCTeam1987/3061-lib minus the actual fork, special permissions nor any other administrative actions are required. All it needs is a blank repo and a personal access token that has write access to the repo.

@jschenke488
Copy link
Contributor Author

The 3061-lib repo can be safely deleted to undo all changes

@jschenke488 jschenke488 self-assigned this Jan 29, 2023
@jschenke488 jschenke488 added enhancement New feature or request forlater Something for later labels Jan 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request forlater Something for later
Projects
None yet
Development

No branches or pull requests

1 participant