{"id":15642135,"url":"https://github.com/peter-evans/s3-backup","last_synced_at":"2025-04-14T15:42:05.336Z","repository":{"id":35187099,"uuid":"197913139","full_name":"peter-evans/s3-backup","owner":"peter-evans","description":"A GitHub action to mirror a repository to S3 compatible object storage","archived":false,"fork":false,"pushed_at":"2023-11-20T14:03:25.000Z","size":23,"stargazers_count":66,"open_issues_count":3,"forks_count":26,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-28T04:35:04.329Z","etag":null,"topics":["backup-utility","github-action","s3-storage"],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/peter-evans.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":"2019-07-20T10:09:19.000Z","updated_at":"2024-11-24T09:39:20.000Z","dependencies_parsed_at":"2024-06-18T16:53:13.067Z","dependency_job_id":"6171a496-0984-4352-b85a-a0672f29dfb6","html_url":"https://github.com/peter-evans/s3-backup","commit_stats":{"total_commits":31,"total_committers":6,"mean_commits":5.166666666666667,"dds":0.4838709677419355,"last_synced_commit":"96efa6c1849122ecacecbd17dc123d7af5a7a619"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peter-evans%2Fs3-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peter-evans%2Fs3-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peter-evans%2Fs3-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peter-evans%2Fs3-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peter-evans","download_url":"https://codeload.github.com/peter-evans/s3-backup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248758424,"owners_count":21156959,"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":["backup-utility","github-action","s3-storage"],"created_at":"2024-10-03T11:54:47.907Z","updated_at":"2025-04-14T15:42:05.315Z","avatar_url":"https://github.com/peter-evans.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# S3 Backup\n[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-S3%20Backup-blue.svg?colorA=24292e\u0026colorB=0366d6\u0026style=flat\u0026longCache=true\u0026logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAM6wAADOsB5dZE0gAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAERSURBVCiRhZG/SsMxFEZPfsVJ61jbxaF0cRQRcRJ9hlYn30IHN/+9iquDCOIsblIrOjqKgy5aKoJQj4O3EEtbPwhJbr6Te28CmdSKeqzeqr0YbfVIrTBKakvtOl5dtTkK+v4HfA9PEyBFCY9AGVgCBLaBp1jPAyfAJ/AAdIEG0dNAiyP7+K1qIfMdonZic6+WJoBJvQlvuwDqcXadUuqPA1NKAlexbRTAIMvMOCjTbMwl1LtI/6KWJ5Q6rT6Ht1MA58AX8Apcqqt5r2qhrgAXQC3CZ6i1+KMd9TRu3MvA3aH/fFPnBodb6oe6HM8+lYHrGdRXW8M9bMZtPXUji69lmf5Cmamq7quNLFZXD9Rq7v0Bpc1o/tp0fisAAAAASUVORK5CYII=)](https://github.com/marketplace/actions/s3-backup)\n\nA GitHub action to mirror a repository to S3 compatible object storage.\n\n## Usage\n\nThis example will mirror your repository to an S3 bucket called `repo-backup-bucket` and at the optional key `/at/some/path`. Objects at the target will be overwritten, and extraneous objects will be removed. This default usage keeps your S3 backup in sync with GitHub.\n\n```yml\n    - name: S3 Backup\n      uses: peter-evans/s3-backup@v1\n      env:\n        ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY_ID }}\n        SECRET_ACCESS_KEY: ${{ secrets.SECRET_ACCESS_KEY }}\n        MIRROR_TARGET: repo-backup-bucket/at/some/path\n      with:\n        args: --overwrite --remove\n```\n\nS3 Backup uses the `mirror` command of [MinIO Client](https://github.com/minio/mc).\nAdditional arguments may be passed to the action via the `args` parameter.\n\n#### Secrets and environment variables\n\nThe following variables may be passed to the action as secrets or environment variables. `MIRROR_TARGET`, for example, if considered sensitive should be passed as a secret.\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- `AWS_SESSION_TOKEN` - When using temporary credentials (Amazon S3)\n- `AWS_REGION` (required with AWS_SESSION_TOKEN) - the region where the s3 bucket is located for Amazon S3. **Mandatory** when using SESSION_TOKEN.\n- `MIRROR_SOURCE` - The source defaults to the repository root. If required a path relative to the root can be set.\n- `STORAGE_SERVICE_URL` - The URL to the object storage service. Defaults to `https://s3.amazonaws.com` for Amazon S3.\n- `STORAGE_SERVICE_ALIAS` - Defaults to `s3`. See [MinIO Client](https://github.com/minio/mc) for other options such as S3 compatible `minio`, and `gcs` for Google Cloud Storage.\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\nIf required you can create a policy to restrict access to specific resources.\nThe following policy grants the user access to the bucket `my-restricted-bucket` and its contents.\n\n```\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"AllowBucketStat\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": \"arn:aws:s3:::my-restricted-bucket\"\n        },\n        {\n            \"Sid\": \"AllowThisBucketOnly\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"s3:*\",\n            \"Resource\": [\n                \"arn:aws:s3:::my-restricted-bucket/*\",\n                \"arn:aws:s3:::my-restricted-bucket\"\n            ]\n        }\n    ]\n}\n```\n\n## Complete workflow example\n\nThe workflow below filters `push` events for the `master` branch before mirroring to S3.\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: S3 Backup\n        uses: peter-evans/s3-backup@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\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeter-evans%2Fs3-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeter-evans%2Fs3-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeter-evans%2Fs3-backup/lists"}