Syncs a repository to AWS CodeCommit using AWS Credentials authorized through GitHub OIDC token.
Name | Meaning | Required? | Default Value |
---|---|---|---|
role-to-assume |
The ARN for AWS IAM Role to be assumed while making requests to AWS CodeCommit | Yes | N/A |
aws-region |
The AWS region that the CodeCommitRepository is in | No | us-east-1 |
repository |
The name of repository being synced | No | Context Value: github.repository |
- Configure GitHub OIDC in AWS for authorization. See this.
- The IAM Role used for OIDC should have permissions for AWS CodeCommit's
GetRepository
,CreateRepository
andGitPush
APIs.
In the repository you want to sync to AWS CodeCommit, create a GitHub workflow to invoke this action.
name: Sync Repository to AWS CodeCommit
on:
push:
branches: [ "**" ]
jobs:
sync:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Sync to AWS CodeCommit
uses: shubhdarlinge/sync-repository-to-aws-codecommit@v4
with:
role-to-assume: arn:aws:iam::1234567890:role/FakeRepositorySyncRole