setnemo / bygone

Archive your old repositories to one repo (git history included) with Github Actions

Home Page:https://habr.com/ru/post/570404/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bygone project

Save your old buggy code as a souvenir (git history included)

How it work?

  1. Create new repository for arhive your projects.
  2. Create a personal access token (not the default GitHub Actions token) using the instructions here. Personal access token must have permissions: read:user and repo. Copy the access token when it is generated – if you lose it, you will have to regenerate the token.
  3. Fork this project
  4. If this is the README of your fork, click this link to go to the "Secrets" page. Otherwise, go to the "Settings" tab of the newly-created repository and go to the "Secrets" page (bottom left).
  5. Create 5 secrets:
    • ARCHIVED_REPOSITORY - please add username/projectName for saving to arhive repo
    • ARCHIVE_REPOSITORY - real arhive repo, format username/projectName (from step 0.)
    • ARCHIVE_REPOSITORY_DEFAULT_BRANCH - main or master - default branch in archive repo
    • GIT_USERNAME - your username at Github for pushing to arhive repo
    • WRITE_GITHUB_TOKEN - your github api token from step 1.
  6. Open Actions > archivist and press 'Run workflow'
  7. Enjoy!
  8. Star this repo if you like it!

Example archive

My arhive repo: setnemo/arhive

What will be added to the archive?

Bygone create new folder like username/projectName/branchName and save all branches with git history.

How can I archive more than one project?

Just update ARCHIVED_REPOSITORY to another repo and run workflow again


MIT License, Artem Pakhomov, 2021

About

Archive your old repositories to one repo (git history included) with Github Actions

https://habr.com/ru/post/570404/

License:MIT License