{"id":23927229,"url":"https://github.com/miklosn/github-action-rotate-gcp-key","last_synced_at":"2025-08-30T23:33:44.028Z","repository":{"id":44675331,"uuid":"307775979","full_name":"miklosn/github-action-rotate-gcp-key","owner":"miklosn","description":"Rotate Google Service Account Keys for Github Actions","archived":false,"fork":false,"pushed_at":"2022-12-09T08:18:29.000Z","size":74,"stargazers_count":7,"open_issues_count":2,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-05-25T18:15:45.981Z","etag":null,"topics":["gcp","github-secret"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/miklosn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-27T17:21:13.000Z","updated_at":"2024-11-21T21:16:58.000Z","dependencies_parsed_at":"2023-01-11T17:22:36.618Z","dependency_job_id":null,"html_url":"https://github.com/miklosn/github-action-rotate-gcp-key","commit_stats":{"total_commits":13,"total_committers":3,"mean_commits":4.333333333333333,"dds":"0.23076923076923073","last_synced_commit":"cdf842b212058a597eb83a17c4d7c84212c2c69b"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/miklosn/github-action-rotate-gcp-key","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miklosn%2Fgithub-action-rotate-gcp-key","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miklosn%2Fgithub-action-rotate-gcp-key/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miklosn%2Fgithub-action-rotate-gcp-key/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miklosn%2Fgithub-action-rotate-gcp-key/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miklosn","download_url":"https://codeload.github.com/miklosn/github-action-rotate-gcp-key/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miklosn%2Fgithub-action-rotate-gcp-key/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261390757,"owners_count":23151639,"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":["gcp","github-secret"],"created_at":"2025-01-05T22:15:00.948Z","updated_at":"2025-06-23T00:34:37.833Z","avatar_url":"https://github.com/miklosn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# github-action-rotate-gcp-key\n\nThis action rotates GCP service account keys in with the following method:\n\n1. Create a new key for the SA\n2. Update the specified Github secret (in one or more repos)\n3. Delete all keys which do not equal the newly created key and which are also older than 5 minutes (to prevent race errors)\n\n## Example workflow\n\n```yaml\n\nname: Rotate GCP service account key\n#on:\n#  schedule:\n#    - cron: '0 12 * * 1'\non: [workflow_dispatch]\njobs:\n  rotate:\n    name: rotate gcp key\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2.0.0\n      - name: Setup GCP Service Account\n        uses: google-github-actions/setup-gcloud@master\n        with:\n          service_account_key: ${{ secrets.GCP_SA_INFRA_KEY }}\n          export_default_credentials: true\n      - name: rotate gcp keys\n        uses: miklosn/github-action-rotate-gcp-key@main # WARNING: use explicit Git commit sha instead of 'main' to avoid becoming a victim of supply chain attacks\n        with:\n          projectId: \"example\"\n          serviceAccount: \"github-actions@example.iam.gserviceaccount.com\"\n          personalAccessToken: \"${{ secrets.PERSONAL_ACCESS_TOKEN }}\"\n          repositories: ${{ github.repository }}\n          secretName: \"GCP_SA_INFRA_KEY\"\n```\n\n## Inputs\n\n\nprojectId: GCP project id to operate on\n\nserviceAccount: e-mail ID of the service account to operate on\n\npersonalAccessToken: github token with permission to add/update secrets on a repo basis\n\nsecretName: name of the Github secret to update\n\nrepositories: one or multiple github repos. If multiple repos are specified they need to be separated by commas. \nThe secret will be updated in all repos.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiklosn%2Fgithub-action-rotate-gcp-key","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiklosn%2Fgithub-action-rotate-gcp-key","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiklosn%2Fgithub-action-rotate-gcp-key/lists"}