You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Github Migrations Backup
1.0.0
This GitHub Action allows you to backup and archive a organization repository to an S3 Bucket with the help of the GitHub Organization migrations API
The Migrations API is only available to authenticated organization owners. For more information, see "Roles in an organization" and "Other authentication methods."
- name: Github Org Backup
uses: skrepr/[email protected]
env:
GH_ORG: ${GITHUB_ACTOR}
GH_APIKEY: ${GITHUB_TOKEN}
GH_REPO: ${GITHUB_REPOSITORY}
AWS_BUCKET_NAME: "your-bucket-here"
AWS_BUCKET_REGION: "eu-west-1"
AWS_ARN: "arn:aws:s3:::your-bucket-here"
AWS_ACCESS_KEY: ${AWS_ACCESS_KEY} # Github Secret is advised
AWS_SECRET_KEY: ${AWS_SECRET_KEY} # Github Secret is advised
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::your-bucket-here"
]
},
{
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject"
],
"Resource": [
"arn:aws:s3:::your-bucket-here/*"
]
}
]
}
Github migrations only archives your .git from every repository.
To recover your code from the archive:
- Place all the repo.git files in a .git folder.
- Execute the command
git init
- After Git has reinitialized the project, execute
git reset --hard HEAD
MIT / BSD
This Github Action was created in 2022 by Jeroen van der Meulen, commisioned by Skrepr