{"id":20824240,"url":"https://github.com/sayak119/back-se","last_synced_at":"2025-07-17T03:34:55.696Z","repository":{"id":128572819,"uuid":"245767118","full_name":"sayak119/back-se","owner":"sayak119","description":"This GitHub action can mirror a GitHub repository to S3 compatible storage.","archived":false,"fork":false,"pushed_at":"2020-03-08T07:11:18.000Z","size":155,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-06T11:17:42.360Z","etag":null,"topics":["dockerfile","github-actions","minio","s3-bucket"],"latest_commit_sha":null,"homepage":null,"language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sayak119.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-08T06:55:26.000Z","updated_at":"2020-03-14T13:11:55.000Z","dependencies_parsed_at":"2023-04-20T21:32:37.782Z","dependency_job_id":null,"html_url":"https://github.com/sayak119/back-se","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sayak119%2Fback-se","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sayak119%2Fback-se/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sayak119%2Fback-se/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sayak119%2Fback-se/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sayak119","download_url":"https://codeload.github.com/sayak119/back-se/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243172129,"owners_count":20247885,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dockerfile","github-actions","minio","s3-bucket"],"created_at":"2024-11-17T22:21:28.180Z","updated_at":"2025-03-12T06:44:25.464Z","avatar_url":"https://github.com/sayak119.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BackSE\n\nA GitHub action to mirror a repository to S3 compatible object storage. This has been implemented using **mirror** command of [MinIO Client](https://github.com/minio/mc). Please refer MinIO client. A **screenshot** is attached below too.\n\n![MinIO commands](images/minio-commands.png)\n\n## Usage of the action\n\n- Given below is an example that will mirror your repository to an **S3 bucket** called **backup-bucket**. We can also add path to it (optional) **/a/b/c**.\n- Objects present at the given mirror taeget will be overwritten.\n- This default usage keeps your **S3 bucket** backup in sync with GitHub.\n- More paramters can be passed using the `args` parameter. They are mentioned [here](https://docs.min.io/docs/minio-client-complete-guide.html) or can be found below.\n\n![arguments](images/args.png)\n\n```yml\n    - name: S3 Backup\n      uses: sayak119/back-se@v1\n      env:\n        ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY_ID }}\n        SECRET_ACCESS_KEY: ${{ secrets.SECRET_ACCESS_KEY }}\n        MIRROR_TARGET: backup-bucket/a/b/c\n      with:\n        args: --overwrite\n```\n\n## ENV variables and keys\n\nThese variables or keys can be added to the GitHub action.\n\n- `ACCESS_KEY_ID` (**required**) - The storage service access key id.\n- `SECRET_ACCESS_KEY` (**required**) - The storage service secret access key.\n- `MIRROR_TARGET` (**required**) - The target bucket, and optionally, the key within the bucket.\n- `MIRROR_SOURCE` - The source defaults to the repository root. You can also set a path relative to the root.\n- `STORAGE_SERVICE_URL` - The URL to the object storage service. Default value is `https://s3.amazonaws.com` for S3.\n- `STORAGE_SERVICE_ALIAS` - Defaults to `s3`.\n\n## IAM user policy\n\nThe IAM user associated with the `ACCESS_KEY_ID` and `SECRET_ACCESS_KEY` should have `s3:*` policy access.\n\nThe following policy grants the user access to the bucket `myExampleBucket` and its contents. Policies can be modified to restrict access. You can refer [here](https://aws.amazon.com/blogs/security/how-to-restrict-amazon-s3-bucket-access-to-a-specific-iam-role/), [here](https://aws.amazon.com/blogs/security/iam-policies-and-bucket-policies-and-acls-oh-my-controlling-access-to-s3-resources/) or [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html).\n\n```\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"AllowBucketStat\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:HeadBucket\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"AllowThisBucketOnly\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"s3:*\",\n            \"Resource\": [\n                \"arn:aws:s3:::myExampleBucket/*\",\n                \"arn:aws:s3:::myExampleBucket\"\n            ]\n        }\n    ]\n}\n```\n\n## Workflow example\n\nGiven below is a **workflow** example that filters `push` events for the `master` branch before mirroring to S3 bucket.\n\n```yml\nname: Mirror repo to S3\non:\n  push:\n    branches:\n      - master\njobs:\n  s3Backup:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n      - name: Back SE\n        uses: sayak119/back-se@v1\n        env:\n          ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY_ID }}\n          MIRROR_TARGET: ${{ secrets.MIRROR_TARGET }}\n          SECRET_ACCESS_KEY: ${{ secrets.SECRET_ACCESS_KEY }}\n        with:\n          args: --overwrite --remove\n```\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsayak119%2Fback-se","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsayak119%2Fback-se","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsayak119%2Fback-se/lists"}